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

后端 未结 2 1613
无人及你
无人及你 2021-01-18 06:56

I am invoking a test method (Junit) with an annotated application context (@ContextConfiguration(locations={\"classpath:applicationContext.xml\"})). The test fa

2条回答
  •  猫巷女王i
    2021-01-18 07:14

    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.

提交回复
热议问题