HTTP 400 Bad Request JIRA | puce | 1 year ago
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    My analysis so far is as following: AbstractRootElementJaxbProvider throws subclasses of WebApplicationException instead of an IOException: At least in the latest version this handled somewhat in JerseyInvocation, where WebApplicationException gets catched and wrapped by a ResponseProcessingException. This is wakwards since the nested exception provides a wrong HTTP status code (eg. "HTTP 400 Bad Request", where the request itself was succesful. In the end the nested WebApplicationException gets unwrapped again: So I think the best thing would be if the AbstractRootElementJaxbProvider class would throw IOException. The case of a thrown WebApplicationException should never arise when calling response.readEntity (translate method). So the catch clause should be removed and it should be made sure this case never arises (otherwise it would still be catched by the Exception catch statement). The unwrapping of the cause of the ProcessingException in the translate method also seems wrong in some cases (e.g. when there is no cause). Why not just set the ProcessingException itself as cause? The IllegalStateException is not handled specially while ProcessingException is. Seems inconsistent. And last but not least the WebApplicationException should not be unwrapped in the invoke method. Again, I think WebApplicationException should never be the cause of a ProcessingException anyway. JIRA | 1 year ago | puce HTTP 400 Bad Request

    Root Cause Analysis


      HTTP 400 Bad Request

      at org.glassfish.jersey.jaxb.internal.AbstractRootElementJaxbProvider.readFrom()
    2. org.glassfish.jersey
      1. org.glassfish.jersey.jaxb.internal.AbstractRootElementJaxbProvider.readFrom(
      1 frame
    3. Jersey Core
      1. org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(
      2. org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(
      3. org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(
      4. org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(
      5. org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(
      6. org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(
      6 frames
    4. jersey-core-client
      1. org.glassfish.jersey.client.ClientResponse.readEntity(
      2. org.glassfish.jersey.client.InboundJaxrsResponse$
      2 frames
    5. Jersey Core
      1. org.glassfish.jersey.internal.Errors.process(
      2. org.glassfish.jersey.internal.Errors.process(
      3. org.glassfish.jersey.internal.Errors.process(
      4. org.glassfish.jersey.process.internal.RequestScope.runInScope(
      4 frames
    6. jersey-core-client
      1. org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(
      2. org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(
      2 frames