It's not a secret anymore!*
The moose likes Servlets and the fly likes NoClassDefFound Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "NoClassDefFound Error" Watch "NoClassDefFound Error" New topic
Author

NoClassDefFound Error

Jason Kwok
Ranch Hand

Joined: Mar 31, 2005
Posts: 126
Hi,

I just recently upgraded Tomcat from version 4.0 to 5.5, which I know supports the new servlet standards. My problem is that my servlets all generate this NoClassDefFound error, stating an illegal name for my serlvets. How do I fix this? Is there something I need to add to my web.xml file?

If it helps, I can post my web.xml and sample servlets to help identify the problem, just let me know!!



Thanks to any and all advice!!
Jason

[ August 22, 2006: Message edited by: Jason Kwok ]
[ August 22, 2006: Message edited by: Jason Kwok ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

What does your web.xml look like?


GenRocket - Experts at Building Test Data
Jason Kwok
Ranch Hand

Joined: Mar 31, 2005
Posts: 126
Thanks for the quick reply Gregg, unfortunately I'm at work and don't have the web.xml file available right now. It's my fault for assuming I wouldn't get a response so soon.

My web.xml file is rather simple. I just define the servlet using servlet-element and then I've also added serlvet-mappings for a few of them as well.

example:


I'll post my full web.xml this evening. So sorry about that!!

Thanks again,
Jason
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

servlet-element is not used in new containers. You would just use <servlet>. Might consider glancing at the new specs for J2EE. Quite a bit has changed since whatever version Tomcat 4.0 supported.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5

Shouldn't that be separated with a . instead of a /?

Bill
Jason Kwok
Ranch Hand

Joined: Mar 31, 2005
Posts: 126
You're absolutely right, I do need to check over the new servlet specs!! And I'll try adjusting my web.xml file accordingly.

Thanks again Gregg!!
Jason Kwok
Ranch Hand

Joined: Mar 31, 2005
Posts: 126
Originally posted by William Brogden:

Shouldn't that be separated with a . instead of a /?

Bill


Quite right. Thanks... just a typo on my part!!
 
Consider Paul's rocket mass heater.
 
subject: NoClassDefFound Error