运行spring mvc web-app时出现Java ClassNotFoundException

时间:2016-04-06 07:07:37

标签: java spring-mvc

我使用spring MVC创建了一个动态Web项目。但是在运行它的同时 在服务器上我得到了以下异常.EVERE:

java.lang.NoClassDefFoundError: org/springframework/core/env/ConfigurableEnvironment
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getDeclaredConstructor(Class.java:1985)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(Contex tLoader.java:348)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:281)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    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)
Caused by: java.lang.ClassNotFoundException: 
org.springframework.core.env.ConfigurableEnvironment
06-Apr-2016 07:00:39 org.apache.catalina.core.StandardContext listenerStart

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

java.lang.NoClassDefFoundError: org/springframework/core/env/ConfigurableEnvironment
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)

以下是我使用的罐子。

    spring-asm-3.0.7.RELEASE.jar
    spring-beans-3.0.7.RELEASE.jar
    spring-context-3.0.7.RELEASE.jar
    spring-core-3.0.7.RELEASE.jar
    spring-expression-3.0.7.RELEASE.jar
    spring-web-3.0.7.RELEASE.jar
    spring-webmvc-3.0.7.RELEASE.jar
    commons-logging-api-1.1.jar
    jstl-1.2.jar

1 个答案:

答案 0 :(得分:0)

根据docs 这个类从版本3.1开始可用,但你有3.0。