欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l

程序员文章站 2022-03-26 16:49:35
启动tomcat后报出错误如下:总的就是(org.apache.catalina.core.ContainerBase.addChildInternalContainerBase.addChild: start:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]])16-Aug-2020 13:54:43.808 信息 [m...

启动tomcat后报出错误如下:总的就是(
org.apache.catalina.core.ContainerBase.addChildInternal
ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]])

16-Aug-2020 13:54:43.808 信息 [main]
org.apache.catalina.startup.Catalina.start Server startup in 52 ms
Connected to server [2020-08-16 01:54:43,996] Artifact ssmbuild:war
exploded: Artifact is being deployed, please wait… 16-Aug-2020
13:54:44.238 警告 [RMI TCP Connection(3)-127.0.0.1]
org.apache.tomcat.util.descriptor.web.WebXml.setVersion 未知版本字符串
[4.0]。将使用默认版本。 16-Aug-2020 13:54:44.261 严重 [RMI TCP
Connection(3)-127.0.0.1]
org.apache.catalina.core.ContainerBase.addChildInternal
ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at
org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at
org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1719)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:479)
at
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:428)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at
com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at
javax.management.remote.rmi.RMIConnectionImpl.access300(RMIConnectionImpl.java:76)atjavax.management.remote.rmi.RMIConnectionImpl300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImplPrivilegedOperation.run(RMIConnectionImpl.java:1309)
at java.security.AccessController.doPrivileged(Native Method) at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200) at
sun.rmi.transport.Transport1.run(Transport.java:197)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.Transport.serviceCall(Transport.java:196)atsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)atsun.rmi.transport.tcp.TCPTransport1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) at sun.rmi.transport.tcp.TCPTransportConnectionHandler.run0(TCPTransport.java:834)
at
sun.rmi.transport.tcp.TCPTransportConnectionHandler.lambdaConnectionHandler.lambdarun0(TCPTransport.java:688)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.tcp.TCPTransport0(TCPTransport.java:688) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransportConnectionHandler.run(TCPTransport.java:687)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) Caused by:
java.lang.IllegalArgumentException:
找到多个名为spring_web的片段。这是不合法的相对排序。有关详细信息,请参阅Servlet规范的第8.2.2
2c节。考虑使用绝对排序。 at
org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2203)
at
org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2162)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1134)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:779)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5053)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
… 44 more 16-Aug-2020 13:54:44.275 严重 [RMI TCP
Connection(3)-127.0.0.1]
org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception
invoking method manageApp java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:747)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at
org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1719)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:479)
at
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:428)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at
com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at
javax.management.remote.rmi.RMIConnectionImpl.access300(RMIConnectionImpl.java:76)atjavax.management.remote.rmi.RMIConnectionImpl300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImplPrivilegedOperation.run(RMIConnectionImpl.java:1309)
at java.security.AccessController.doPrivileged(Native Method) at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200) at
sun.rmi.transport.Transport1.run(Transport.java:197)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.Transport.serviceCall(Transport.java:196)atsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)atsun.rmi.transport.tcp.TCPTransport1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) at sun.rmi.transport.tcp.TCPTransportConnectionHandler.run0(TCPTransport.java:834)
at
sun.rmi.transport.tcp.TCPTransportConnectionHandler.lambdaConnectionHandler.lambdarun0(TCPTransport.java:688)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.tcp.TCPTransport0(TCPTransport.java:688) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransportConnectionHandler.run(TCPTransport.java:687)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-08-16 01:54:44,286] Artifact ssmbuild:war exploded: Error during
artifact deployment. See server log for details. at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) 16-Aug-2020 13:54:44.275 严重
[RMI TCP Connection(3)-127.0.0.1]
org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception
invoking method createStandardContext
javax.management.RuntimeOperationsException: Exception invoking
method manageApp at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:294)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:479)
at
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:428)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at
com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at
javax.management.remote.rmi.RMIConnectionImpl.access300(RMIConnectionImpl.java:76)atjavax.management.remote.rmi.RMIConnectionImpl300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImplPrivilegedOperation.run(RMIConnectionImpl.java:1309)
at java.security.AccessController.doPrivileged(Native Method) at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200) at
sun.rmi.transport.Transport1.run(Transport.java:197)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.Transport.serviceCall(Transport.java:196)atsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)atsun.rmi.transport.tcp.TCPTransport1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) at sun.rmi.transport.tcp.TCPTransportConnectionHandler.run0(TCPTransport.java:834)
at
sun.rmi.transport.tcp.TCPTransportConnectionHandler.lambdaConnectionHandler.lambdarun0(TCPTransport.java:688)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.tcp.TCPTransport0(TCPTransport.java:688) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransportConnectionHandler.run(TCPTransport.java:687)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) Caused by:
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:747)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at
org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1719)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286)
… 35 more 16-Aug-2020 13:54:53.805 信息 [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录
[D:\tomcat\apache-tomcat-8.5.57\webapps\manager] 16-Aug-2020
13:54:53.905 信息 [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory
Web应用程序目录[D:\tomcat\apache-tomcat-8.5.57\webapps\manager]的部署已在[99]毫秒内完成

打开Project Structure后看到的是,发现和之前的不太一样,servlet-api的jar包在外面,可能是导入错误,
整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l
本地仓库打开后发现有两个servlet-api,一个是javax.servlet-api版本是3.1,还有一个是servlet-api版本是2.5和2.4,重新导入依赖,然后加入lib下后
整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l
然后刚才的错误好了,相继出现了以下错误,第一眼就想起来是xml文件中没有修改正确,idea会自动导入cache,但是导入的是错误的,我只改了后面,没有改前面
整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l

修改之后重新reload就启动了浏览器
整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l

点击进入书籍页面后出现错误
整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l
开始排查错误
问题:bean不存在
步骤:
1.查看这个bean注入是否成功!ok
2. Junit单元测试,看我们的代码是否能够查询出来结果!ok
3.问题,一定不在我们的底层,spring出问题了
4.SpringMVC,整合的时候没调用到我们的service层的bean;

  • applicationcontext.xml没有注入bean
  • web.xml中,我们也绑定过配置文件!,发现问题,我们配置的是spring-mvc.xml
    这里面确实没有service bean,所以报空指针
    整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l
    整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l
    整合ssm框架的时候出现错误org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[l
    只改applicationContext.xml就可以了

步骤2测试的时候显示找不到哪些测试的方法,没有绑定,这里重要的事情说三遍!!!加资源过滤加资源过滤加资源过滤

 <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> <include>**/*.properties</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.xml</include> <include>**/*.properties</include> </includes> </resource> </resources> </build> 

本文地址:https://blog.csdn.net/weixin_46500568/article/details/108035702