开发者社区> 问答> 正文

今天开始学习servlet简单的写了一次web.xml以后tomcat就一直报错 ?报错

今天开始学习servlet简单的写了一次web.xml以后tomcat就一直报错,即使重新下ecLipse和tomcat也是一直报错

展开
收起
爱吃鱼的程序员 2020-06-23 20:51:29 784 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    问题:严重:Achildcontainerfailedduringstart
    java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    atjava.util.concurrent.FutureTask.report(FutureTask.java:122)
    atjava.util.concurrent.FutureTask.get(FutureTask.java:192)
    atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
    atorg.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    atjava.util.concurrent.FutureTask.run(FutureTask.java:266)
    atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    atjava.lang.Thread.run(Thread.java:745)
    Causedby:org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    ...6more
    Causedby:java.lang.NoSuchMethodError:javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
    atorg.apache.tomcat.websocket.server.WsServerContainer.(WsServerContainer.java:150)
    atorg.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131)
    atorg.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:47)
    atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ...6more

    三月22,20174:11:04下午org.apache.catalina.core.ContainerBasestartInternal
    严重:Achildcontainerfailedduringstart
    java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Servlet]]
    atjava.util.concurrent.FutureTask.report(FutureTask.java:122)
    atjava.util.concurrent.FutureTask.get(FutureTask.java:192)
    atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
    atorg.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    atjava.util.concurrent.FutureTask.run(FutureTask.java:266)
    atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    atjava.lang.Thread.run(Thread.java:745)
    Causedby:org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Servlet]]
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    ...6more
    Causedby:java.lang.NoSuchMethodError:javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
    atorg.apache.tomcat.websocket.server.WsServerContainer.(WsServerContainer.java:150)
    atorg.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131)
    atorg.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:47)
    atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ...6more

    三月22,20174:11:04下午org.apache.catalina.core.ContainerBasestartInternal
    严重:Achildcontainerfailedduringstart
    java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardEngine[Catalina].StandardHost[localhost]]
    atjava.util.concurrent.FutureTask.report(FutureTask.java:122)
    atjava.util.concurrent.FutureTask.get(FutureTask.java:192)
    atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
    atorg.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    atorg.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    atorg.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    atorg.apache.catalina.startup.Catalina.start(Catalina.java:629)
    atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    atjava.lang.reflect.Method.invoke(Method.java:498)
    atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
    atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
    Causedby:org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardEngine[Catalina].StandardHost[localhost]]
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    atjava.util.concurrent.FutureTask.run(FutureTask.java:266)
    atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    atjava.lang.Thread.run(Thread.java:745)
    Causedby:org.apache.catalina.LifecycleException:Achildcontainerfailedduringstart
    atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
    atorg.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ...6more

    三月22,20174:11:04下午org.apache.catalina.startup.Catalinastart
    严重:TherequiredServercomponentfailedtostartsoTomcatisunabletostart.
    org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardServer[8005]]
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    atorg.apache.catalina.startup.Catalina.start(Catalina.java:629)
    atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    atjava.lang.reflect.Method.invoke(Method.java:498)
    atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
    atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
    Causedby:org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardService[Catalina]]
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    atorg.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ...7more
    Causedby:org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardEngine[Catalina]]
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    atorg.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ...9more
    Causedby:org.apache.catalina.LifecycleException:Achildcontainerfailedduringstart
    atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
    atorg.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ...11more

    三月22,20174:11:04下午org.apache.coyote.AbstractProtocolpause
    信息:PausingProtocolHandler["http-nio-8080"]
    三月22,20174:11:04下午org.apache.coyote.AbstractProtocolpause
    信息:PausingProtocolHandler["ajp-nio-8009"]
    三月22,20174:11:04下午org.apache.catalina.core.StandardServicestopInternal
    信息:StoppingserviceCatalina
    三月22,20174:11:04下午org.apache.coyote.AbstractProtocoldestroy
    信息:DestroyingProtocolHandler["http-nio-8080"]
    三月22,20174:11:04下午org.apache.coyote.AbstractProtocoldestroy
    严重:FailedtodestroyendpointassociatedwithProtocolHandler["http-nio-8080"]
    java.lang.NullPointerException
    atorg.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:316)
    atorg.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:492)
    atorg.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:883)
    atorg.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551)
    atorg.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
    atorg.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    atorg.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)
    atorg.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    atorg.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:879)
    atorg.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    atorg.apache.catalina.startup.Catalina.start(Catalina.java:633)
    atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    atjava.lang.reflect.Method.invoke(Method.java:498)
    atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
    atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

    三月22,20174:11:04下午org.apache.coyote.AbstractProtocoldestroy
    信息:DestroyingProtocolHandler["ajp-nio-8009"]
    三月22,20174:11:04下午org.apache.coyote.AbstractProtocoldestroy
    严重:FailedtodestroyendpointassociatedwithProtocolHandler["ajp-nio-8009"]
    java.lang.NullPointerException
    atorg.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:316)
    atorg.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:492)
    atorg.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:883)
    atorg.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551)
    atorg.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
    atorg.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    atorg.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)
    atorg.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    atorg.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:879)
    atorg.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
    atorg.apache.catalina.startup.Catalina.start(Catalina.java:633)
    atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    atjava.lang.reflect.Method.invoke(Method.java:498)
    atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
    atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

    把你的web.xml贴出来看一下

    你看看配置的tomcat是7.0还是软件自带的,tomcat主页能打开么

    启动Tomcat有问题吗?

    你把Eclipse中的Tomcat删掉,然后再重新导入到Eclipse中,试一下

    应该是你web.xml中配置有问题,或是缺jar包了

    2020-06-23 20:51:47
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Tomcat 的云原生演进 立即下载
WEB SERVICE EFFICENCY 立即下载
从Web到Cloud App 立即下载