Hi,
I have the following endpoint in my application:
@PUT
@Produces(APPLICATION_JSON)
@Consumes(MULTIPART_FORM_DATA)
@Transactional
public Response updateData(@FormDataParam(":data") final InputStream data)
{
// do stuff
}
If I call this endpoint without a multipart body and no content-type I end
up in a NPE (see below).
If I call this endpoint without a multipart body and content-type
"multipart/form-data" I receive a proper 400 response.
If I call this endpoint without a multipart body and content-type
"text/plain" I receive a proper 415 response.
Is this is a know issue or am I anticipating something wrong here?
This is the (shortend) NPE stacktrace:
java.lang.NullPointerException
at
org.glassfish.jersey.media.multipart.internal.FormDataParamValueFactoryProvider$FormDataParamValueFactory.provide(FormDataParamValueFactoryProvider.java:203)[32:org.glassfish.jersey.media.jersey-media-multipart:2.9.0]
at
org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:81)[89:org.glassfish.jersey.core.jersey-server:2.9.0]
at
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$AbstractMethodParamInvoker.getParamValues(JavaResourceMethodDispatcherProvider.java:121)[89:org.glassfish.jersey.core.jersey-server:2.9.0]
at
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)[89:org.glassfish.jersey.core.jersey-server:2.9.0]
at
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)[89:org.glassfish.jersey.core.jersey-server:2.9.0]
at
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)[89:org.glassfish.jersey.core.jersey-server:2.9.0]
at
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)[89:org.glassfish.jersey.core.jersey-server:2.9.0]
at
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)[89:org.glassfish.jersey.core.jersey-server:2.9.0]
at
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:269)[89:org.glassfish.jersey.core.jersey-server:2.9.0]
Thanks!
Cheers
Philipp