maven项目(错误一) 项目启动时报“org.springframework.core.env.ConfigurableEnvironment”的解决方案

一 问题描述:

maven项目,由于jar冲突,导致项目启动时报错:

09:58:25,070 ERROR [org.springframework.web.context.ContextLoader] (org.springframework.web.context.ContextLoader:324) - Context initialization failed
java.lang.NoClassDefFoundError: org/springframework/core/env/ConfigurableEnvironment
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
	at java.lang.Class.getConstructor0(Class.java:2793)
	at java.lang.Class.getDeclaredConstructor(Class.java:2043)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:105)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:348)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:281)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
	at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
	at org.mortbay.jetty.Server.doStart(Server.java:224)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at runjettyrun.Bootstrap.main(Bootstrap.java:275)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.ConfigurableEnvironment
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:392)
	at runjettyrun.ProjectClassLoader.loadClass(ProjectClassLoader.java:320)
	at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
	... 18 more
2015-06-04 09:58:25.073:WARN::failed runjettyrun.HSFJettyWebAppContext@6623a0d3{/,src/main/webapp}: java.lang.NoClassDefFoundError: org/springframework/core/env/ConfigurableEnvironment
2015-06-04 09:58:25.075:WARN::Error starting handlers
java.lang.NoClassDefFoundError: org/springframework/core/env/ConfigurableEnvironment
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
	at java.lang.Class.getConstructor0(Class.java:2793)
	at java.lang.Class.getDeclaredConstructor(Class.java:2043)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:105)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:348)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:281)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
	at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
	at org.mortbay.jetty.Server.doStart(Server.java:224)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at runjettyrun.Bootstrap.main(Bootstrap.java:275)
2015-06-04 09:58:25.088:INFO::Started SelectChannelConnector@0.0.0.0:80
2015-06-04 09:58:25.089:INFO::Started Ajp13SocketConnector@0.0.0.0:8009
2015-06-04 09:58:25.089:INFO::AJP13 is not a secure protocol. Please protect port 8009


二 解决办法:

 找到本地maven库,替换E:\.m2\repository\org\springframework下的所有文件 即可。

如:把m2_xyx.zip解压好的org\springframework替换E:\.m2\repository\org\springframework的文件。

阅读更多
文章标签: maven
个人分类: SSH三大框架
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭