我的应用程序基于Java 8,Spring 3.0.6并在Tomcat 7上运行。
一切正常。
但是,当我将Tomcat版本更新为8时,我得到以下内容。
有人知道Spring 3在Tomcat 8上运行是否有任何问题?
[2016-05-25 11:21:40,307][INFO] - ContextLoader.log: Root WebApplicationContext: initialization started
[2016-05-25 11:21:41,072][ERROR] - ContextLoader.log: Context initialization failed
java.lang.NoClassDefFoundError: org/springframework/core/env/ConfigurableEnvironment
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.8.0_72]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[?:1.8.0_72]
at java.lang.Class.getConstructor0(Class.java:3075) ~[?:1.8.0_72]
at java.lang.Class.getDeclaredConstructor(Class.java:2178) ~[?:1.8.0_72]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104) ~[org.springframework.beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:347) ~[spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:280) [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4813) [catalina.jar:8.0.35]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5272) [catalina.jar:8.0.35]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [catalina.jar:8.0.35]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) [catalina.jar:8.0.35]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) [catalina.jar:8.0.35]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) [catalina.jar:8.0.35]
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092) [catalina.jar:8.0.35]
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834) [catalina.jar:8.0.35]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_72]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_72]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_72]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_72]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72]
Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.ConfigurableEnvironment
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305) ~[catalina.jar:8.0.35]
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139) ~[catalina.jar:8.0.35]
... 21 more
答案 0 :(得分:0)
EnvironmentCapable
课程从3月3.1开始提供。
请运行mvn:dependency tree
命令以正确检查所有依赖项。
答案 1 :(得分:0)
Tomcat8与Spring 3.1或更高版本兼容。你切换到Spring3.1,它将被解决。
答案 2 :(得分:0)
Tomcat 8需要' ConfigurableEnvironment'启动课程。这个类出现在spring-core 3.1.0 jar及其后面。因此,您需要升级您的弹簧版本。