org.springframework.web.context.ContextLoaderListener

选中项目>右键点击项目>Deployment Assembly>点击右边Add按钮
添加Maven:



添加maven、

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方式加载,出错????? 论坛

web.xml配置org.springframework.web.context.ContextLoaderListener监听器出错

12-28

我在web.xml里面加入了监听器(这个工程是用的myeclipse5.5的 struts1.2 + spring2.0 +hibernate 3.0)rnrn org.springframework.web.context.ContextLoaderListenerrnrn但是启动tomcat的时候回出现以下错误rn2007-12-28 14:16:40 org.apache.catalina.core.StandardHost startrn信息: XML validation disabledrnlog4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).rnlog4j:WARN Please initialize the log4j system properly.rn2007-12-28 14:16:58 org.apache.catalina.core.StandardContext startrn严重: Error listenerStartrn2007-12-28 14:16:58 org.apache.catalina.core.StandardContext startrn严重: Context [/b2b.china315.com] startup failed due to previous errorsrn2007-12-28 14:16:59 org.apache.catalina.core.ApplicationContext logrn信息: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: 。。。。。。。。。。。。。。。。。。rnrn请高手指教,我的applicationContex.xml分成了applicationContext-actions.xml 、applicationContext-common.xml和applicationContext-managers.xml 下面我把各个文件粘贴下来rn================================================rnapplicationContex.xml :内容如下rn===========================================rnrnrnrnrnrn rnrn===================================rnapplicationContext-common.xml内容如下rn====================================rnrnrnrnrn rn classpath:hibernate.cfg.xml rn rnrnrnrnrn rn rn rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rnrnrn rn rnrn rnrn======================================rnapplicationContext-managers.xml 内容如下rn======================================rnrnrnrnrnrnrnrn 论坛

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

04-24

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPoolrnCaused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPoolrn at java.lang.Class.getDeclaredConstructors0(Native Method)rn at java.lang.Class.privateGetDeclaredConstructors(Class.java:2359)rn at java.lang.Class.getConstructor0(Class.java:2667)rn at java.lang.Class.getDeclaredConstructor(Class.java:1984)rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:752)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:717)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)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)rn2008-4-24 21:13:17 org.apache.catalina.core.StandardContext startrn严重: Error listenerStartrn2008-4-24 21:13:17 org.apache.catalina.core.StandardContext startrn严重: Context [/bookstore] startup failed due to previous errorsrnrnrnrn找了好多方法解决不了呀....rn什么asm.**.jar 也删除了...rn怎么还是在创建dataSource的实例时出错呢?rn难道是配置dataSource Bean 的时候出错了?rn这个是spring 自动生成的呀...rn有请高手...rnrnrnweb.xml配置如下:我想应该不会配置错吧..rnrnrnrn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn contextConfigLocationrn /WEB-INF/applicationContext.xmlrn rnrn rn struts2rn rn org.apache.struts2.dispatcher.FilterDispatcherrn rn rn rn struts2rn /*rn rnrnrnrnrnrn 论坛

web东西集成时发生问题,主要是org.springframework.web.context.ContextLoaderListener问题

09-26

我单独运行自己的程序没有错误,可是集成其他人的就出错了.其他人用纯servlet做的.rnweb.xml如下: rnrn rn contextConfigLocationrn /WEB-INF/applicationContext.xmlrn rnrn rn Oracle Datasource examplern jdbc/icssrn javax.sql.DataSourcern Containerrn rnrn rn struts2rn org.apache.struts2.dispatcher.FilterDispatcherrn rn rn struts2rn /*rn rnrn rn org.springframework.web.context.ContextLoaderListenerrn rnrnrn错误信息如下rn2008-09-26 19:02:50 [org.springframework.web.context.ContextLoader]-[ERROR] Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'staffDao' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ynu.dao.impl.StaffDaoImpl]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: rn The import org.springframework cannot be resolvedrn The import org.springframework cannot be resolvedrn SimpleJdbcDaoSupport cannot be resolved to a typern The method getSimpleJdbcTemplate() is undefined for the type StaffDaoImplrn ParameterizedRowMapper cannot be resolved to a typern rnrn2008-9-26 19:02:50 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 'staffDao' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ynu.dao.impl.StaffDaoImpl]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: rn The import org.springframework cannot be resolvedrn The import org.springframework cannot be resolvedrn SimpleJdbcDaoSupport cannot be resolved to a type 论坛

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