This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes could not find writer for content-type application/xml type: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "could not find writer for content-type application/xml type:" Watch "could not find writer for content-type application/xml type:" New topic
Author

could not find writer for content-type application/xml type:

Elangovan Shanmugam
Greenhorn

Joined: Sep 06, 2009
Posts: 10
Hi all,

I am trying to develop client side code for my RestEasy RESTful web service. When I am trying to create a (POST) request with my complex xml type, I am getting the following error. Could you please throw some tips why would this happen? or What am I doing wrong.



I did check the generated DTO (JAXB) object, and it does have the @XMLRootElement and other annotations.

Thanks
Elangovan S
Elangovan Shanmugam
Greenhorn

Joined: Sep 06, 2009
Posts: 10
I resolved this a while back and thought post the answer to this thread as well.

Solution: Just add the jaxb-provider dependency to the client project, something like as follows. Even though this is not required for compile time, this is needed for the run-time, in the above situation.


Thanks
 
 
subject: could not find writer for content-type application/xml type:
 
Similar Threads
How to set the Content type in JavaMail
Setting content-type in HTTPURLConnection ?
DELETE http request in HttpURLConnection....
Setting Content-type
Having Problems open a xml file generated with mpxj