This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Im a newbie to Spring. Im trying to build a client app which can consume Restful services from our internal API's to populate data in the client. (The API's are RESTful CXF JAX-RS in nature)

Im using the booking-mvc sample from Spring downloads and Im working off on this. Everything was working fine until I switched the datasource from using some test data to web api response.

I read about RestTemplate support in Spring 3.0 and thought this might be the solution.Unfortunately, I have hit a dead-end and Im unable to figure out if Im looking at the right technologies to use or if Im doing something drastically wrong.

Im just trying to get RestTemplate to work with a static xml file at : /WEB-INF/hotels/test.xml file.

I would greatly appreciate any help or advice on what technologies/libraries to use to consume CXF JAX-RS services which are outside of my stand alone client app. Is this possible using RestTemplate , if so , please let me know what is the right way to integrate this into my app.

Comment

Sorry about that, I wasnt sure what formatting was required. Thanks for the tip

I did notice that I was including some spring 3.0.5 jars in my tomcat classpath for older projects, I went ahead and removed those.
But, I still get the same error and the same stack trace.(I did a text compare and found no stark difference)

My application class path has the following jars which were downloaded using maven.
spring3.0.5
spring-webflow2.3.1
spring-security3.0.2
xstream-1.4.2

I also see maven downloaded jaxb-api-2.1.ar ( Im not sure if xstream plays along well with this)

The rest of the application however, runs just fine until the controller switches to the method where I have implemented the RestTemplate code. I am using XStream library for marshalling.

Comment

After talking to my team, they said they had trouble unmarshalling with xstream library and suggested that I use jaxb.
After making the changes in the code and reading sample tutorials for implementing Jaxb2Marshaller, Im able to get restTemplate to work in my project.

Thank you for helping out but it would be great to know why the above error was thrown, so I can get a complete understanding of the scenario. Im still completely new to Spring and still trying the ropes. So, Im sure I might have missed something in the above experiment.