java.lang.ClassNotFoundException:org.springFramework.web.context.ContextLoaderListener tomcat 9,maven,spring

时间:2018-03-24 09:14:24

标签: spring maven spring-mvc tomcat

我的网络项目突然停止了工作。

我已尝试过所有内容,将maven依赖项添加到类路径,删除spring-web.jar并添加回来,删除tomcat并添加回来等等。

请帮助我,我不知道如何修复它,阅读这个问题的所有答案,没有任何帮助。

  

SEVERE:配置类[org.springFramework.web.context.ContextLoaderListener]的应用程序侦听器时出错   java.lang.ClassNotFoundException:org.springFramework.web.context.ContextLoaderListener       在org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)       在org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1104)       at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:540)       在org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:521)       在org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4559)       在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099)       在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)       在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1425)       在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1415)       at java.util.concurrent.FutureTask.run(Unknown Source)       在org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)       at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)       在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)       在org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)       在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)       在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1425)       在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1415)       at java.util.concurrent.FutureTask.run(Unknown Source)       在org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)       at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)       在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)       在org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)       在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)       at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)       在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)       在org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)       在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)       在org.apache.catalina.startup.Catalina.start(Catalina.java:682)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)       at java.lang.reflect.Method.invoke(Unknown Source)       在org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)       在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)

pom.xml spring-web依赖

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>5.0.4.RELEASE</version>
</dependency>

的web.xml

<listener>
    <listener-class>org.springFramework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        classpath:com/spring/web/context/dao-context.xml
        classpath:com/spring/web/context/service-context.xml
    </param-value>
</context-param>

1 个答案:

答案 0 :(得分:0)

  

此Blog告诉您解决此问题的几种方法。

ClassNotFoundException : org.springframework.web.context.ContextLoaderListener

  

这个问题也在这里讨论,您可以从这里获得大量信息...

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener