Having a very simple WS application with a REST endpoint that consumes a JSON object:
@Path("hello") public class HelloWorld { @POST @Path("entity") @Produces({MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_JSON}) public Greeting helloEntity(Greeter greeter) { return new Greeting(greeter); } }
If the resteasy-client with the the ResteasyWebTarget proxy is used:
System.out.println( ((ResteasyWebTarget) ClientBuilder.newClient() .target("http://jboss.sample.com:8080") .path("resteasy-test") .path("ws") .path("hello")) .proxy(HelloWorldInterface.class) .helloEntity(null));
The following exception is thrown at client side (no data is sent):
java.lang.IllegalArgumentException: Arguments must not be null.
at javax.ws.rs.core.GenericEntity.<init>(GenericEntity.java:148)
at org.jboss.resteasy.client.jaxrs.internal.proxy.processors.invocation.MessageBodyParameterProcessor.process(MessageBodyParameterProcessor.java:35)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.createRequest(ClientInvoker.java:135)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:101)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:64)
at com.sun.proxy.$Proxy39.helloEntity(Unknown Source)
at com.redhat.sample.test.Client.main(Client.java:63)
You can send a null using the standard jax-rs methods:
System.out.println(ClientBuilder.newClient() .target("http://jboss.sample.com:8080") .path("resteasy-test") .path("ws") .path("hello") .path("entity") .request(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .post(Entity.entity(null, MediaType.APPLICATION_JSON)) .readEntity(Greeting.class));
- clones
-
RESTEASY-1684 "Arguments must not be null" when sending a null JSON object with ResteasyWebTarget
- Closed
- is cloned by
-
JBEAP-11860 [GSS](7.2.z) "Arguments must not be null" when sending a null JSON object with ResteasyWebTarget
- Closed
-
WFLY-9091 "Arguments must not be null" when sending a null JSON object with ResteasyWebTarget
- Closed
- is incorporated by
-
JBEAP-12230 Upgrade RESTEasy to 3.0.24.Final
- Closed