• 1 reply
  • Latest Post - ‏2006-09-15T13:12:39Z by SystemAdmin
1215 Posts

Pinned topic Failed to load servlet: java.lang.ClassNotFoundException

‏2006-09-12T15:03:38Z |
I've been working on a project with other developers and we've all have our own sections of a large web application that we are working on. When we are each done working on our part we send our JSPs, Beans, and servlets to the lead developer that then deploys one EAR file on our Test/QA server. I now asked the tech lead if he could send me the EAR file so I can load the application in its entirety on my local machine. When I start up the server, I get the error "Failed to load servlet: java.lang.ClassNotFoundException" for each one of my servlets. Even if the servlet path is correct I still get that error. I also tried removing the servlet in the web.xml file and then adding it again, but I still get that error. Has anyone experienced anything like this before? Is this error appearing because I haev two projects (my part of the application with only my code and the complete project from the EAR file) that point to the same servlets? I'm not sure how to resolve this. Any advice would be greatly appreciated. Thanks in advance!
Updated on 2006-09-15T13:12:39Z at 2006-09-15T13:12:39Z by SystemAdmin
  • SystemAdmin
    1215 Posts

    Re: Failed to load servlet: java.lang.ClassNotFoundException

    OK I just realized something.

    The Java Source Code File is in the com\comp\ids\admin\servlet. However, when I look at the classes folder under WEB-INF I do not see the compiled class file for that servlet. That's why I'm getting the error ClassNotFound. (I didn't check that folder because I just assumed the class file was there if the java file was there). In any case I tried to Rebuild the Project in webshpere, but the class files still did not appear. I also tried to change the the java source code and resave it so that websphere would automatically recompile the code, but the class file still does not appear. I also tried to delete the project and reimport the EAR file. In doing so websphere adds folders and directories that are not from my co-workers directory structure. They are actually folders from my other projects. It seems to be importing those classes. I tried deleting those folders and recompiling, but the class files do not appear in their appropriate folder. I'm not sure what websphere is doing.