Spring-java.lang.NoSuchMethodError:org.springframework.web.accept.ContentNegotiationManager.getStrategies()Ljava/util/List ;? [英] Spring - java.lang.NoSuchMethodError: org.springframework.web.accept.ContentNegotiationManager.getStrategies()Ljava/util/List;?
本文介绍了Spring-java.lang.NoSuchMethodError:org.springframework.web.accept.ContentNegotiationManager.getStrategies()Ljava/util/List ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将我的pom.xml更新为使用Springframework 4.2.3版本(从4.1.2版本开始)后,应用程序无法使用
After updating my pom.xml to use Springframework version 4.2.3 (from 4.1.2), the application fails to start-up with
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter': Invocation of init method failed; nested except
ion is java.lang.NoSuchMethodError: org.springframework.web.accept.ContentNegotiationManager.getStrategies()Ljava/util/List;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
我已经尝试过Maven清理,重建等,但是错误仍然存在.
I've tried Maven Clean, rebuild, etc, but the error persists.
我怀疑一个旧的JAR藏在某个地方,但是在哪里?!
I suspect an old JAR is being held somewhere, but where?!
推荐答案
您的lib中最有可能是spring-web-4.X.X.RELEASE.jar文件的旧版本.只是检查一下
Most likely you have in your lib an old version of spring-web-4.X.X.RELEASE.jar file. Just check that
这篇关于Spring-java.lang.NoSuchMethodError:org.springframework.web.accept.ContentNegotiationManager.getStrategies()Ljava/util/List ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文