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.
As discussed in issue 209515 the formatting of JSON response on GlassFish 3.1.1 is incompatible with what some clients expect. For example instead of expected [{"name":"abc","map":{"key3":"value4","1":"2"}}] the GlassFish with Jersey version<2 responses with: {"data":{"name":"abc","map":{"entry":[{"key":"key3","value":"value4"},{"key":"1","value":"2"}]}}} We should think how to make this working out of the box for users who are writing static web client applications based on JavaScript. In vanilla JAX-RS case the solution can be: A) add jackson-jaxrs-1.7.1.jar to project's classpath or B) return org.codehaus.jackson.jaxrs.JacksonJsonProvider provider in user's implementation of javax.ws.rs.core.Application.getClasses (eg. by calling Class.forName("org.codehaus.jackson.jaxrs.JacksonJsonProvider") which will succeed in runtime) In Jersey case the solution is to add following parameter to Jersey's servlet: <init-param> <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> <param-value>true</param-value> </init-param>
It would be useful to know what's the proposed solution for Jersey 2.0, so we can make this future-proof and consistent with the future behavior.
The problem is not glassfish-only. The same issue is valid for WL. It's common Jersey-related issue.
web-main#6fdde71e18ea
Integrated into 'main-golden', will be available in build *201208020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/6fdde71e18ea User: Denis Anisimov <ads@netbeans.org> Log: Fix for BZ#209969 - JSON response format is not readable by JavaScript libraries like backbone.js