在eclipse中启动maven项目是报错
严重: Error configuring application listener of class org.t.ContextLoaderListener
java.lang.ClassNotFoundException: org.t.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at org.StandardContext.listenerStart(StandardContext.java:4078)
at org.StandardContext.start(StandardContext.java:4630)
at org.ContainerBase.start(ContainerBase.java:1045)
at org.StandardHost.start(StandardHost.java:785)
at org.ContainerBase.start(ContainerBase.java:1045)
at org.StandardEngine.start(StandardEngine.java:445)
java.lang.ClassNotFoundException: org.t.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at org.StandardContext.listenerStart(StandardContext.java:4078)
at org.StandardContext.start(StandardContext.java:4630)
at org.ContainerBase.start(ContainerBase.java:1045)
at org.StandardHost.start(StandardHost.java:785)
at org.ContainerBase.start(ContainerBase.java:1045)
at org.StandardEngine.start(StandardEngine.java:445)
at org.StandardService.start(StandardService.java:519)
at org.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at flect.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)
2012-4-12 9:18:01 org.StandardContext listenerStart
严重: Error configuring application listener of class com.iris.scm.web.servlet.StartupListener
java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
at java.DeclaredConstructors0(Native Method)
at org.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at flect.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)
2012-4-12 9:18:01 org.StandardContext listenerStart
严重: Error configuring application listener of class com.iris.scm.web.servlet.StartupListener
java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
at java.DeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.Constructor0(Class.java:2699)
at java.wInstance0(Class.java:326)
at java.wInstance(Class.java:308)
at org.StandardContext.listenerStart(StandardContext.java:4079)
at org.StandardContext.start(StandardContext.java:4630)
at org.ContainerBase.start(ContainerBase.java:1045)
at org.StandardHost.start(StandardHost.java:785)
at org.ContainerBase.start(ContainerBase.java:1045)
at org.StandardEngine.start(StandardEngine.java:445)
at org.StandardService.start(StandardService.java:519)
at org.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at java.Constructor0(Class.java:2699)
at java.wInstance0(Class.java:326)
at java.wInstance(Class.java:308)
at org.StandardContext.listenerStart(StandardContext.java:4079)
at org.StandardContext.start(StandardContext.java:4630)
at org.ContainerBase.start(ContainerBase.java:1045)
at org.StandardHost.start(StandardHost.java:785)
at org.ContainerBase.start(ContainerBase.java:1045)
at org.StandardEngine.start(StandardEngine.java:445)
at org.StandardService.start(StandardService.java:519)
at org.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at flect.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)
Caused by: java.lang.ClassNotFoundException: t.ApplicationContext
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at flect.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)
Caused by: java.lang.ClassNotFoundException: t.ApplicationContext
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
... 20 more
这个是由于配置文件引起的问题,需要修改两个配置文件,如下:
1.项目根目录下的.project文件,用记事本打开,加入以下代码(把原来的<buildSpec>节点和<n
atures>替换了):
<buildSpec>
<buildCommand>
<name>lipse.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>lipse.wstmon.builder</bootstrap项目name>
<arguments>
<buildCommand>
<name>lipse.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>lipse.wstmon.builder</bootstrap项目name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>lipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>aven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.lipse.maven2Builder</name>
<arguments>
</buildCommand>
<buildCommand>
<name>lipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>aven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.lipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.lipse.maven2Nature</nature>
<nature>aven2Nature</nature>
<nature>lipse.jem.workbench.JavaEMFNature</nature>
<nature>dulecore.ModuleCoreNature</nature>
<nature>lipse.wstmon.ature</nature>
<nature>javanature</nature>
<nature>lipse.jsNature</nature>
</natures>
</buildCommand>
</buildSpec>
<natures>
<nature>org.lipse.maven2Nature</nature>
<nature>aven2Nature</nature>
<nature>lipse.jem.workbench.JavaEMFNature</nature>
<nature>dulecore.ModuleCoreNature</nature>
<nature>lipse.wstmon.ature</nature>
<nature>javanature</nature>
<nature>lipse.jsNature</nature>
</natures>
2.项目根目录下的.classpath,到
<classpathentry kind="con" path="org.lipse.MAVEN2_CLASSPATH_CONTAINER"/>
替换为:
<classpathentry kind="con" path="org.lipse.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="lipse.jstponent.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<attributes>
<attribute name="lipse.jstponent.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
新增加一个classpathentry节点:
<classpathentry kind="con" path="lipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="lipse.jstponent.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<attributes>
<attribute name="lipse.jstponent.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
OK,到这一步已经完成了,到eclipse中刷新项目,然后重新启动tomcat,错误已经解决!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论