I migrated my Spring framework from 3.x to 4.2.RELEASE but, when I start the jUnit I'm getting this error:
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [file:src/test/resources/applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/http/converter/json/MappingJacksonHttpMessageConverter
I read on internet from Version 4.1. it's not supported anymore; I checked and the new version is available on application class path (I imported spring-web dependency). ( Spring 4 and Rest WS integration )
It seems spring is still looking for the old version of Converter. It probably depends on something I've on my application context, but, the question is, how can I "tell to Spring" to use new version?
-- UPDATE
I commented
<mvc:annotation-driven />
and it seems to works fine but... why?
There's a newer version of that class in Spring 4: use org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
(note the '2').
In my REST servlet's Spring config file I have it configured as follows (I added my custom objectMapper to it, but you can just omit that):
<mvc:annotation-driven>
<mvc:message-converters>
<bean
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="objectMapper">
<bean class="s3.util.json.CustomJsonMapper" />
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With