Have anyone made Jersey work at Google AppEngine with POJO Mapping to JSON? I've been spending some hours on getting this working now, but I'm stuck at two places. Running locally at Jetty I get one step further than at AppEngine, but I'm not there yet either. Here are the two problems I am encountering:
Locally:
Jetty produces the following error:
SEVERE: A message body writer for Java class
nilsnett.chinese.backend.BusinessObject, and Java type class
nilsnett.chinese.backend.BusinessObject, and MIME media type
application/json was not found
nilsnett.chinese.backend.BusinessObject
is a plain Java class I've created
that looks like this:
package nilsnett.chinese.backend;
import javax.xml.bind.annotation.XmlRootElement;
public class BusinessObject {
public String text;
public int value;
}
What is wrong here?
At AppEngine:
Uncaught exception from servlet
java.lang.IncompatibleClassChangeError
Now I had this error locally as well, and it's related to the fact that I'm
both referring asm-3.3.1.jar
, which Jersey depends on, and asm-4.0.jar,
which AppEngine depends on. If I _only_ referenced
asm-4.0.jar` locally, I
would get the same error here. Referencing both does obviously not work well
at AppEngine. How can I get around this?
More data:
- Full Jetty log of local error here
- Full exception log from AppEngine here
- My web.xml
SDK's referenced:
- AppEngine v1.7.4
- Java SE 1.6
Jar's relevant to Jersey referenced:
- Jersey-bundle-1.17.jar
- Asm-3.3.1.jar
- Jettison-1.1jar
I'm Developing in Eclipse Juno on Windows 8.