Search code examples
eclipsetomcateclipse-wtp

WTP deployments without publishing fails


I'm currently on Tomcat 7.0.21, JDK1.6.29, and WTP 3.3.1 (running on Eclipse Indigo.) I'm not sure which version of M2E I'm running. My Project builds and deploys fine when I either do a mvn install and run Tomcat outside of Eclipse, or deploy to the server via WTP with the "Serve Modules without publishing" unchecked.

However, when I start the server via WTP with the no-publish box checked, Tomcat won't start successfully, failing with:

Dec 29, 2011 4:09:39 PM org.apache.catalina.startup.ContextConfig processAnnotationsJndi
SEVERE: Unable to process JNDI URL [jndi:/localhost/plutom-ws/WEB-INF/classes] for annotations
java.io.FileNotFoundException: jndi:/localhost/plutom-ws/WEB-INF/classes
    at 
org.apache.naming.resources.DirContextURLConnection.list(DirContextURLConnection.java:463)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1901)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1905)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1828)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1295)

If I manually create the classes directory, it then complains about classes/com It seems like there's a conflict between a classloader and a file path resolve somewhere?


Solution

  • This is unfortunately a known bug between Eclipse WTP and Tomcat 7. Here are the relevant Bugzilla entries:

    Tomcat 7 + Serve Modules without publishing fails to find classpath resources

    Really fix "Serve modules without publishing" with tomcat 7 by using the new VirtualDirContext of tomcat >=7.0.24

    Apparently the fix is known, it just hasn't been applied yet. I guess it isn't a common use-case, because otherwise more people would be requesting it to be fixed. Its too bad, its a very useful feature.