严重:启动期间子容器失败

时间:2015-11-02 04:41:01

标签: java spring tomcat

以前我的tomcat服务器工作正常。

但突然出现以下错误。

请帮助解决此问题

  

严重:子容器在启动时失败   java.util.concurrent.ExecutionException:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [卡塔利娜] .StandardHost [本地主机] .StandardContext [/项目-1]]     在java.util.concurrent.FutureTask.report(未知来源)at   java.util.concurrent.FutureTask.get(未知来源)at   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)     在   org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1559)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1549)     在java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)at   java.lang.Thread.run(未知来源)引起:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [卡塔利娜] .StandardHost [本地主机] .StandardContext [/项目-1]]     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     ... 6更多引起:java.lang.IllegalArgumentException:The   servlet名为[Project-1]和   [com.example.project_1.Project_1UI $ Servlet]都映射到了   url-pattern [/ *]是不允许的   org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:335)     在   org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2466)     在   org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2148)     在   org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2109)     在   org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2102)     在   org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2102)     在   org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2102)     在   org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)     在   org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)     在   org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)     在   org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)     在   org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)     在   org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ......还有6个

     

2015年11月2日上午9:50:09 org.apache.catalina.core.ApplicationContext   log INFO:未检测到Spring WebApplicationInitializer类型   classpath 2015年11月2日上午9:50:09   org.apache.catalina.core.ApplicationContext log INFO:设置web app root   系统属性:' webapp.root' =   [C:\用户\赛\ Documents.metadata.plugins \ org.eclipse.wst.server.core \ TMP0 \ wtpwebapps \ LorryHub]   2015年11月2日上午9:50:09 org.apache.catalina.core.ApplicationContext   log INFO:从中初始化log4j   [C:\用户\赛\ Documents.metadata.plugins \ org.eclipse.wst.server.core \ TMP0 \ wtpwebapps \ LorryHub \ WEB-INF \ log4j.lorryhub.properties]   log4j:ERROR setFile(null,true)调用失败。   java.io.FileNotFoundException:C:\ Users \ LorryHub \ lorryhub.log(The   系统找不到指定的路径)   java.io.FileOutputStream.open(Native Method)at   java.io.FileOutputStream。(未知来源)at   java.io.FileOutputStream。(未知来源)at   org.apache.log4j.FileAppender.setFile(FileAppender.java:294)at at   org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)     在   org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)     在   org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)     在   org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)     在   org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)     在   org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)     在   org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)     在   org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)     在   org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)     在   org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)     在   org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:415)     在   org.springframework.util.Log4jConfigurer.initLogging(Log4jConfigurer.java:72)     在   org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:152)     在   org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)     在   org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)     在   org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1559)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1549)     在java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)at   java.lang.Thread.run(Unknown Source)2015年11月2日9:50:10 AM   org.apache.catalina.core.ApplicationContext log INFO:正在初始化   Spring FrameworkServlet' MainWeb' 2015年11月2日上午9:50:18   org.apache.catalina.core.ContainerBase startInternal SEVERE:一个孩子   启动时容器失败java.util.concurrent.ExecutionException:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [Catalina] .StandardHost [localhost]] at   java.util.concurrent.FutureTask.report(未知来源)at   java.util.concurrent.FutureTask.get(未知来源)at   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)     在   org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.startup.Catalina.start(Catalina.java:691)at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at   java.lang.reflect.Method.invoke(未知来源)at   org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)at at   org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)导致   by:org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [Catalina] .StandardHost [localhost]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1559)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1549)     在java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)at   java.lang.Thread.run(未知来源)引起:   org.apache.catalina.LifecycleException:子容器失败   在开始时   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)     在

     

org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ......还有6个

     

2015年11月2日上午9:50:18 org.apache.catalina.startup.Catalina开始   严重:所需的服务器组件无法启动,因此Tomcat是   无法开始。 org.apache.catalina.LifecycleException:失败   启动组件[StandardServer [8005]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     在org.apache.catalina.startup.Catalina.start(Catalina.java:691)at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at   java.lang.reflect.Method.invoke(未知来源)at   org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)at at   org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)导致   by:org.apache.catalina.LifecycleException:无法启动组件   [StandardService [Catalina]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     在   org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 7更多引起:org.apache.catalina.LifecycleException:失败   启动组件[StandardEngine [Catalina]]   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     在   org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 9更多引起:org.apache.catalina.LifecycleException:一个孩子   容器在启动时失败   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)     在   org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ......还有11个

由于

1 个答案:

答案 0 :(得分:1)

我猜错误日志说明了一切。您在tomcat上部署了多个servlet,并在其web.xml中映射了相同的URL模式[/ *] The servlets named [Project-1] and [com.example.project_1.Project_1UI$Servlet] are both mapped to the url-pattern [/*] which is not permitted at org.apache.catalina.deploy.WebXml.addServletMapping

这很令人困惑,因为只要您点击URL localhost:[yourPort]/[AppName-Maybe]/,容器就不会知道要调用哪个servlet。尝试浏览web.xml并修复此问题,或者您可以在此处发布相同内容并获得其他帮助。