Details
-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
7.0.0.ER5
-
None
Description
I have jaxb annoted class Parent - and the following resource:
@GET @Path("/{name}") @Consumes("application/json") @Produces("application/json") public Parent getParent(@PathParam("name") String name) { Parent parent = Parent.createTestParent(name); return parent; }
Proxy client is defined as this:
@Consumes("application/json") @Produces("application/json") public interface JsonJAXBXmlRootElementClient { @GET @Path("/{name}") Parent getParent(@PathParam("name") String name); }
The request is send using proxy client:
jsonClient = ProxyBuilder.builder(JsonJAXBXmlRootElementClient.class, client.target(JAXB_URL)).build(); Parent parent = jsonClient.getParent(JSON_PARENT);
The application contains dependencies to both - jackson and jackson2 providers.
Then I get the following result:
javax.ws.rs.client.ResponseProcessingException: javax.ws.rs.ProcessingException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "child" (Class org.jboss.resteasy.test.Parent), not marked as ignorable at [Source: org.apache.http.conn.EofSensorInputStream@62df0ff3; line: 1, column: 32] (through reference chain: org.jboss.resteasy.test.Parent["child"]) at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:141) at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:59) at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104) at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:64) ...
The removal of dependencies for jackson1 makes the test pass. Also using "jboss-deployment-descriptor.xml" it is possible to exclude jackson2 provider (leaving jackson1 as active and the test passes as well.)
Please see attached reproducer. The testcase is based on upstream tescase org.jboss.resteasy.test.providers.jaxb.TestJAXBXmlRootElementProvider.
Attachments
Issue Links
- is cloned by
-
RESTEASY-1303 UnrecognizedPropertyException when processing json response by client proxy
- Closed