与类加载相关的战争部署错误

时间:2011-01-06 09:49:14

标签: java spring tomcat classloader

当我部署war文件并运行它时会出现错误,如

  

org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader

Jan 6, 2011 3:16:04 PM org.apache.catalina.startup.HostConfig deployDescriptor 
INFO: Deploying configuration descriptor servlet.xml 
Jan 6, 2011 3:16:04 PM org.apache.catalina.core.StandardContext preDeregister 
SEVERE: error stopping 
LifecycleException: Pipeline has not been started 
at org.apache.catalina.core.StandardPipeline.stop(StandardPipeline.java:257) 
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4629) 
at org.apache.catalina.core.StandardContext.preDeregister(StandardContext.java:5370) 
at org.apache.tomcat.util.modeler.BaseModelMBean.preDeregister(BaseModelMBean.java:1130) 
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.preDeregisterInvoke(DefaultMBeanServerInterceptor.java:1048) 
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:421)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:403) 
at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:506) 
at org.apache.tomcat.util.modeler.Registry.unregisterComponent(Registry.java:575) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) 
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) 
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:521) 
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1359) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) 
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) 
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) 
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500) 
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:849) 
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:351) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:199) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859) 
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) 
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555) 
at java.lang.Thread.run(Thread.java:619) 
Jan 6, 2011 3:16:05 PM org.apache.catalina.loader.WebappLoader start 
SEVERE: LifecycleException 
java.lang.ClassNotFoundException: org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader 
at java.net.URLClassLoader$1.run(URLClassLoader.java:200) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(URLClassLoader.java:188) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:306) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:251) 
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) 
at java.lang.Class.forName0(Native Method) 
at java.lang.Class.forName(Class.java:169) 
at org.apache.catalina.loader.WebappLoader.createClassLoader(WebappLoader.java:773) 
at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:638) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4341) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) 
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) 
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:521) 
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1359) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) 
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) 
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) 
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500) 
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:849) 
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:351) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:199) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859) 
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) 
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555) 
at java.lang.Thread.run(Thread.java:619) 
Jan 6, 2011 3:16:05 PM org.apache.catalina.core.ContainerBase addChildInternal 
SEVERE: ContainerBase.addChild: start: 
LifecycleException: start: : java.lang.ClassNotFoundException: org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader 
at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:679) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4341) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) 
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) 
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:521) 
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1359) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) 
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) 
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) 
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500) 
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:849) 
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:351) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:199) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859) 
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) 
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555) 
at java.lang.Thread.run(Thread.java:619) 
Jan 6, 2011 3:16:05 PM org.apache.catalina.startup.HostConfig deployDescriptor 
SEVERE: Error deploying configuration descriptor servlet.xml 
java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: start: : java.lang.ClassNotFoundException: org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:795) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) 
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) 
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:521) 
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1359) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) 
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) 
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) 
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500) 
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:849) 
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:351) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:199) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) 
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859) 
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) 
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555) 
at java.lang.Thread.run(Thread.java:619) 

context.xml文件 - >>>>>>

<?xml version="1.0" encoding="UTF-8"?> 
<Context antiJARLocking="true" path="servlet"> 
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/> 
</Context> 

失败 - 无法在上下文路径/ servlet部署应用程序

所以我该如何解决呢

2 个答案:

答案 0 :(得分:2)

错误消息明确指出:

java.lang.ClassNotFoundException:
  org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader

您是否已验证该类是否存在于webapp类路径中?

答案 1 :(得分:0)

交叉检查您是否在项目/ WEB-INF / lib /文件夹中部署了所有必需的jar文件(例如:springs.jar)