Parsing applicationContext.xml renders a `java.lang.NoSuchMethodError`. Could this be caused by dependency issues?

笑着哭i 提交于 2019-12-01 17:23:50

I just encountered this with Spring 4.1.1.RELEASE, Spring Security 3.2.5.RELEASE and OAuth2 2.0.3.RELEASE. It was OAuth2 that needed the getEnvironment method.

One of the Spring Security dependencies downloaded Spring Beans 4.0.3.RELEASE which does not have getEnvironment. I fixed by explicitly defining spring-beans 4.1.1.RELEASE as a dependency.

As Jens and Xstian hinted, there was a problem with the version of some of the jars in my classpath. Problem solved by doing a mvn clean install -U. I tried that before posting this question, but sometimes it just does not seem to do the trick, while sometimes it does.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!