Monthly Archives: April 2014

So this is a very short post, with a ‘gotcha’. I wasn’t able to find anything about this, thats why I write it down here right now: If you are migrating from Spring 3 to 4 and you have in your pom.xml the following dependency: <properties> <spring.version>3.2.4.RELEASE</spring.version> <junit.version>4.9</junit.version> </properties> … <dependency> <groupId>org.springframework</groupId> <artifactId>spring-mock</artifactId> <version>2.0.8</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> <scope>test</scope> </dependency> Once you migrate to Spring 4 (lets say 4.0.3.RELEASE) and run your tests you might run into a following stacktrace: java.lang.NoSuchMethodError: org.springframework.core.CollectionFactory.createLinkedMapIfPossible(I)Ljava/util/Map; at org.springframework.mock.web.MockHttpServletRequest.<init>(MockHttpServletRequest.java:107) at org.springframework.mock.web.MockHttpServletRequest.<init>(MockHttpServletRequest.java:210) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:171) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:100) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:319) at… Read Article →

Scroll To Top