tomcat7.x中的java.util.concurrent.ExecutionException

时间:2012-02-03 14:01:48

标签: tomcat

我通过在server.xml中为tomcat5.x添加以下行来指定tomcat代码,它运行正常。

<Host name="nsncatbranch" debug="0" appBase="D:/svn/branch/rncom/modules/web/clients/web/web/operationsmanager"
                unpackWARs="false" autoDeploy="false">

                <Logger className="org.apache.catalina.logger.FileLogger"
                    prefix="om_log." suffix=".log"
                    timestamp="true"/>

        <Context path="" docBase="D:/svn/branch/rncom/modules/web/clients/web/web/operationsmanager" debug="0"
               reloadable="false" crossContext="false" />
    </Host>

但是在tomcat7.x中,它给了我以下错误。

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].St
andardHost[nsncatbranch].StandardContext[]]
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1130)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:782)
        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:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[nsncatbranch].Stand
ardContext[]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        ... 7 more
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name invoker
        at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3204)
        at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3183)
        at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1302)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1302)
        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)
        ... 7 more

我没有收到错误,因为我在web.xml中评论了调用者。我正面临下面描述的新错误。

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.addChildInternal(ContainerBase.java:897)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)

1 个答案:

答案 0 :(得分:2)

我有同样的问题,帕特里克是对的,问题出在web.xml文件中。我删除了以下标记:

 <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

它运作正常。所以我的建议是再次检查web.xml文件并确保其中的所有内容都正常。