没有发布的 WTP 部署失败
我目前使用的是 Tomcat 7.0.21、JDK1.6.29 和 WTP 3.3.1(在 Eclipse Indigo 上运行)。我不确定正在运行哪个版本的 M2E。当我在 Eclipse 之外执行 mvn 安装并运行 Tomcat,或者通过 WTP 部署到服务器且未选中“服务模块而不发布”时,我的项目构建和部署都很好。
但是,当我通过 WTP 启动服务器并选中“不发布”框时,Tomcat 将无法成功启动,失败原因为:
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)
如果我手动创建类目录,它会抱怨classes/com 似乎在类加载器和文件路径在某处解析?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这是 Eclipse WTP 和 Tomcat 7 之间的一个已知错误。以下是相关的 Bugzilla 条目:
Tomcat 7 + 未发布的服务模块找不到类路径资源
通过使用 tomcat 的新 VirtualDirContext >= 真正修复 Tomcat 7 中的“无需发布即可提供服务”的问题7.0.24
显然修复是已知的,只是尚未应用。我想这不是一个常见的用例,因为否则会有更多的人要求修复它。太糟糕了,这是一个非常有用的功能。
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.