严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderLis

eclipse中启动maven-webapp工程时报错:

严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4153)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
 at org.apache.catalina.core.StandardService.start(StandardService.java:525)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
 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.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2016-2-22 11:45:38 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class org.springframework.web.util.IntrospectorCleanupListener
java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4153)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
 at org.apache.catalina.core.StandardService.start(StandardService.java:525)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
 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.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

 

启动方式是通过tomcat方式启动的,通过control+shift+T查看org.springframework.web.context.ContextLoaderListener是spring-web.jar中类,在java build path中查看相关类已经引入,但是通过server path(默认在workspace中的.metadata\.plugins\org.eclipse.wst.server.core\tmp0)查看工程中lib文件夹中的jar文件,发现没有一个存在。

在.classpath发现maven配置有问题

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
	<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="output" path="target/classes"/>
</classpath>


没有指定lib的路径

所以修改后

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java"/>
	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
	<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
	    <attributes>
			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="output" path="target/classes"/>
</classpath>


重启工程成功!

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值