Java报错2: org.springframework.web.context.ContextLoaderListener

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1104)
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:540)
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:521)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4501)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5041)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
	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.catalina.startup.Bootstrap.start(Bootstrap.java:353)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)

这是在JavaWeb中,spring与struts2整合时报的错,出错时 使用的spring版本为4.0.4  struts2版本为2.3.20,Tomcat为9.0

出错排查结果:

解决方案:删除了struts2-spring-plugin-2.3.20.jar包

Tomcat启动时,org.springframework.web.context.ContextLoaderListener报错

12-08

错误信息:rn2011-12-8 16:00:21 org.apache.catalina.core.StandardContext listenerStartrnSEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListenerrnjava.lang.ExceptionInInitializerErrorrn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:506)rn at java.lang.Class.newInstance0(Class.java:355)rn at java.lang.Class.newInstance(Class.java:308)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3787)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123)rn at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:578)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:589)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: java.lang.IllegalStateException: Could not load 'ContextLoader.properties': class path resource [ContextLoader.properties] cannot be opened because it does not existrn at org.springframework.web.context.ContextLoader.(ContextLoader.java:138)rn ... 33 morernrn这个问题该怎么解决,谢谢!

org.springframework.web.context.ContextLoaderListener错误

06-01

六月 01, 2017 8:43:49 上午 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'optDAOInterfaceSrc' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/criterion/CriterionrnCaused by: java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterionrn at java.lang.Class.getDeclaredConstructors0(Native Method)rn at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)rn at java.lang.Class.getConstructor0(Class.java:2803)rn at java.lang.Class.getDeclaredConstructor(Class.java:2053)rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:759)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:724)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:387)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1897)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:744)rnCaused by: java.lang.ClassNotFoundException: org.hibernate.criterion.Criterionrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)rn ... 30 morern六月 01, 2017 8:43:49 上午 org.apache.catalina.core.StandardContext startInternalrn严重: Error listenerStart

如此错误:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

07-27

在eclipse下编译通过,运行时报如下错误。注:spring 1.2 Web Libraries已经加过了rn严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListenerrnjava.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListenerrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3617)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)rn at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1069)rn at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1162)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)rn at java.lang.Thread.run(Thread.java:595)rn2006-7-27 15:55:47 org.apache.catalina.core.StandardContext listenerStart

ClassNotFoundException: org.springframework.web.context.ContextLoaderListener异常!

08-17

web.xml使用如下监听方式加载spring时。报错。rn[code=XML]rn rn org.springframework.web.context.ContextLoaderListener rn rnrn rn contextConfigLocationrn classpath:example.xmlrn rn[/code]rnrn目前使用的spring-framework-3.1.2.RELEASE-with-docs下的jar.如下。rncommons-logging-1.1.1.jarrnorg.springframework.asm-3.1.2.RELEASE.jarrnorg.springframework.beans-3.1.2.RELEASE.jarrnorg.springframework.context-3.1.2.RELEASE.jarrnorg.springframework.core-3.1.2.RELEASE.jarrnorg.springframework.expression-3.1.2.RELEASE.jarrnorg.springframework.web-3.1.2.RELEASE.jarrnorg.springframework.web.servlet-3.1.2.RELEASE.jarrn当然我也试过把spring-framework-3.1.2.RELEASE\dist目录下的所有包。也报上面那个错。rntomcat启动就报错说:说找不到org.springframework.web.context.ContextLoaderListener这个类。rn之前我是使用User Library加包方式。网上查一下,直接把包放到lib下。但还是一样的报错。rnrn大侠们,怎么解决呢。我是使用spring3.1.2和tomcat6.0rnrn但我使用下面这个方式加载.却可以正常访问。rn[code=XML]rn rn springMVCrn org.springframework.web.servlet.DispatcherServletrn rn contextConfigLocationrn classpath*:/example.xmlrn rn 1rn rn rn springMVCrn /rn rn[/code]rnrn请大侠们给给意见。这两种加载方式有什么区别。那种方式比较好。还有为什么我使用listener方式加载,出错?????

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭