4

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?

Francis Upton IV
  • 19,322
  • 3
  • 53
  • 57
Jeff Wang
  • 1,837
  • 1
  • 15
  • 29
  • Why are you using no-publish? I mean isn't that the thing that's going to cause your classes to be published to the server? – Francis Upton IV Dec 30 '11 at 01:16
  • 1
    It just means that it'll take my class files and deployments from the /target directory, as opposed to copy the actual war somewhere. Copying the war means that any changes I make needs a stop and restart. No-publish means that I can deal modify html/js/some class files without restart. – Jeff Wang Jan 01 '12 at 19:22

1 Answers1

3

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.

JBCP
  • 13,109
  • 9
  • 73
  • 111