2012-03-06 46 views
0

我在行家2運行發現資源/ WEB-INF /類和我使用的的Apache Tomcat Maven插件爲Tomcat 7 具有以下配置:javax.naming.NameNotFoundException:不與行家Tomcat插件

<plugin> 
    <groupId>org.apache.tomcat.maven</groupId> 
    <artifactId>tomcat7-maven-plugin</artifactId> 
    <version>2.0-beta-1</version> 
    <configuration> 
     <path>/${project.build.finalName}</path> 
    </configuration>  
</plugin> 

但試圖運行與應用程序時MVN tomcat7:運行 我得到以下異常:

SEVERE: Unable to determine URL for WEB-INF/classes 
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found 
     at org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733) 
     at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:546) 
     at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1197) 
     at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:825) 
     at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:300) 
     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) 
     at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) 
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161) 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568) 
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558) 
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
     at java.lang.Thread.run(Thread.java:662) 

請告知如何解決這個異常。

回答

0

看來這是一個與tomcat7-maven-plugin(它是fixed to 7.0.25)捆綁在一起的tomcat版本的問題。有關類似問題,請參見this answer