Hey all,
I am working on a project that uses two servers to communicate back and forth. The one server makes a REST call to the 2nd server. Both are my own code, both use Jersey and so forth. They both use the same .xsd and compiled JAXB classes. From server 1 I can reach server 2 no problem on simple calls. It's when I use the Jersey client code to pass a JAXB object to server 2 that I get the problem.
Client client = Client.create();
WebResource webResource = client.resource(getServerURL()).path("resources/transaction");
Transaction response = webResource.header("Authorization", auth).accept("application/vnd.mycompany..transactions+xml").type("application/vnd.mycompany.transactions+xml").post(Transaction.class, t);
Maybe I am doing this wrong? But when I execute this code I get the
com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type...
exception. I did some searching and see where Paul has replied to make sure all the JAXB libraries are in the class path. I definitely have all these in the WEB-INF/lib folder of my .war app that I deploy on both servers.
So I am stumped as of now why this is telling me to have a message body writer. The Transaction class is a class generated from the .xsd.. and in fact on the server 1, I can make a REST call to it with xml in the format of the Transaction JAXB class, and it works. So I am not sure why it is telling me I need a separate writer.. it should have been part of the JAXB generated shouldn't it?
I am using Jersey client 1.1.5 and GlassFish v3.
Thanks in advance.