This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hello I'm trying to use Jersey http://jersey.java.net/ for the first time. Jersey is the reference implementation of JAX-RS, which is for building RESTful web services in Java. Using NetBeans and GlassFish, getting started was pretty straight forward, I was able to create a RESTful web service that produces html without much difficulty. From what I have read it should be even less effort to make it produce either XML or JSON. Instead of writing code to produce my own HTML, Jersey should invoke JAXB to produce XML or JSON to represent a Java object which needs to be output. This is where I have got stuck. Google shows large numbers of people suffering with the same exception: ====== javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class ====== I've tried a couple of the suggestions but I'm still stuck with the same exception. Some people suggest a need to write your own handling classes, I've not gone down that road because recent Jersey documentation suggests it all works with very little effort. I've got around to thinking that although I am using the current version of NetBeans and the latest GlassFish, these may not be using 100% compatible versions of Jersey. I'm using: JDK 1.6.0_30 (From Oracle) NetBeans 7.2 (Which includes Jersey jar files created 2011-06-24 however they have names which suggest a mysterious version 1.8 whatever that is?) GlassFish 3.1.2.2 (Which includes Jersey 1.11 jar files created 2012-03-31) The current version of Jersey appears to be 1.15 so the Jersey jar files supplied with NetBeans 7.2 which have 1.8 in the name are something of a mystery. I would guess they are some intermediate step on the way to Jersey version 2 but the age of them (2011-06-24) makes me doubt this. Any suggestions ?
I now see that in the sequence of Jersey releases, 1.8 came before 1.11 not after. That solves one mystery, silly me for doing a text sort in my head. 1.8 vs 1.08 never mind. The underlying issue remains, perhaps I should give NetBeans 7.3 beta a try.
I tried NetBeans 7.3 beta, it comes with Jersey 1.13. Sadly the result is still the same exception: javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class <my class>, and Java type class <my class>, and MIME media type application/json was not found
This is NB issuetracker. But I don't see from your description how NB is involved in the your issue. It seems you have runtime issue with Jersey. Jersey is separate product and has separate issue tracker. Please provide detailed steps how do you use NB to face the issue.