I have been all over existing posts that deal with the ClassNotFoundException running a Java web app under Tomcat in Eclipse.
I am unable to provide source code and configuration artifacts because I am working on a proprietary code base. However, through trial and error I have boiled the problem down to its basic elements.
I have project packaged by Maven as a WAR. There are a number of other projects in the workspace on which the primary package depends. This arrangement has been working fine: I can deploy the WAR and the JARs it depends on under a Tomcat instance in Eclipse and the application runs and I can debug it.
Now I have created a new project that for the moment contains a single public class with a public constructor. The maven build works fine and the Eclipse compile workspace works fine. However, when I deploy to Tomcat and exercise an execution path that instantiates the class in the new project, I get a ClassNotFoundException.
I have checked the following items:
- The Web Deployment Assembly for the primary package's project specifies WEB-INF/lib/ as the Deploy Path for the new project;
- The JAR for the new project does in fact end up in the WEB-INF/lib/ folder under the actual deployment folder;
- When I do a clean and publish on the server, the contents of the actual deployment folder do in fact get nuked and get repopulated with all the right JARs;
- The new project's JAR as I find it the WEB-INF/lib in the deployment folder does in fact contain the class I am trying to instantiate;
- The Tomcat log (which includes the startup cycle) contains no errors other than than the ClassNotFoundException;
- I have re-done the Maven build and applied Maven build to the Eclipse projects numerous times;
- I have cleaned and rebuilt in Eclipse numerous times;
- I have cleaned and republished to the web server in Eclipse countless times;
- I have created several new server instances.
Based on existing discussions of the ClassNotFoundException-in-Tomcat problem, these are the only things I have found to check. What else should I be looking into?
Thanks for your help.