Spring上下文初始化失败

时间:2016-11-03 14:03:01

标签: spring spring-mvc

我在尝试运行maven项目时遇到以下异常

严重:StandardWrapper.Throwable java.lang.NoSuchMethodError:org.springframework.core.JdkVersion.isAtLeastJava15()Z     在org.springframework.beans.CachedIntrospectionResults。(CachedIntrospectionResults.java:249)     在org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:144)     在org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:252)     在org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:798)     在org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)     在org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)     在org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:63)     在org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:128)     在javax.servlet.GenericServlet.init(GenericServlet.java:158)     在org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230)     在org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174)     在org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066)     在org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5370)     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5668)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1700)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1690)     at java.util.concurrent.FutureTask.run(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在java.lang.Thread.run(未知来源)

2018年6月23日上午11:26:56 org.apache.catalina.core.StandardContext loadOnStartup 严重:Web应用程序[/ SpringMvcUser]中的Servlet [spring-mvc]抛出了load()异常 java.lang.NoSuchMethodError:org.springframework.core.JdkVersion.isAtLeastJava15()Z     在org.springframework.beans.CachedIntrospectionResults。(CachedIntrospectionResults.java:249)     在org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:144)     在org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:252)     在org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:798)     在org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)     在org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)     在org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:63)     在org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:128)     在javax.servlet.GenericServlet.init(GenericServlet.java:158)     在org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230)     在org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174)     在org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066)     在org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5370)     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5668)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1700)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1690)     at java.util.concurrent.FutureTask.run(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在java.lang.Thread.run(未知来源)

帮我解决这个异常

1 个答案:

答案 0 :(得分:2)

班级org.springframework.core.JdkVersion的Javadoc说:
已过时。从Spring 4.2.1开始,支持通过反射直接检查所需的JDK API变体

在Spring 4.2.6版中,类isAtLeastJava15()中没有方法JdkVersion

您的一些代码似乎是为旧版本的Spring编写的。是混合不同的版本还是您正在使用的库需要其他版本?你检查了你的课程路径吗?