Ok I got back to my original state of the deploy WORKING without any weird cannot instantiate exception. I found this for me very valuable reference
http://ebr.springsource.com/repository/app/bundle/version/detail?name=org.springframework.web.servlet&versio n=3.0.1.RELEASE&searchType=bundlesBySymbolicName&s earchQuery=org.springframework.web.servlet
which says that Spring 3.0.1 actually uses the very old org.codehaus.jackson version 1.0 -as mentioned I tried with the latest 1.8.3 and backwards towards 1.1, neither of them worked.
So I removed all newer versions of org.codehaus.jackson and did a clean build with 1.0, and voila, the deploy is working again.
Thus the issue now is to find out why the json REST web service is not working as expected.
The relevant part in rest-servlet.xml is
Code:
<!-- ========= [ADDED FOR JSON SUPPORT] ========= -->
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="jsonConverter" />
<ref bean="marshallingConverter" />
</list>
</property>
</bean>
<bean id="jsonConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="supportedMediaTypes" value="application/json" />
</bean>
<bean id="marshallingConverter" class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
<constructor-arg ref="jaxbMarshaller" />
<property name="supportedMediaTypes" value="application/xml"/>
</bean>
The relevant code in the Controller (which gets called, verified by the sysout):
Code:
@RequestMapping(method=RequestMethod.GET, value="/locs", headers={"Accept=application/json"})
public @ResponseBody LocationList getLocs() {
System.out.println("DEBUG: getLocs called");
List<Location> locations = locationDS.getAll();
LocationList list = new LocationList(locations);
return list;
}
The unwanted & unexpected result from the RestClient (useful Firefox plugin to make json and other special calls), with added header Accept=application/json, without this header I get the 405 method not allowed instead (which also is somewhat unexpected, should be 406 WITHOUT the header and working fine with the header).
Code:
HTTP Status 406 -
type Status report
message
description The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers ().
Any suggestions or advice are most appreciated.
Cheers!