users@glassfish.java.net

Re: JAX-RS broken when migrating from 3.1.2.2 to 4.0

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Wed, 21 Aug 2013 13:43:19 +0200

Hi Olivier,

you might want to send this to users_at_jersey.java.net, you should receive
better answer there (Jersey is JAX-RS Reference implementation used in
Glassfish).

JAX-RS 2.0 contains change related to precedence of registered
providers, so you might be hitting this change. JAX-RS 1.x behavior can
be enabled by setting property LEGACY_PROVIDER_ORDERING [1].

Getting HTTP status 500 is little strange, I would start with enabling
LOGGER org.glassfish.jersey.* (level CONFIG should be enough).

Regards,
Pavel

[1]
https://jersey.java.net/apidocs/latest/jersey/org/glassfish/jersey/message/MessageProperties.html#LEGACY_WORKERS_ORDERING

On 8/21/13 12:27 PM, Oliver B. Fischer wrote:
> I have normal ear deployment with an REST interface. The application
> works on GF 3.1.2.2 as expected but fails completely on GF 4.0.
>
> While debugging the problem I mentioned what GF 4 never uses my own
> implementation MessageBodyReader while GF 3 it does.
>
> So, what changed? According to the JAX-RS spec, the container should
> iterate through all with @Provider annotated implementations of
> MessageBodyReader. If no reader is found, which accepts the request
> the container should respond with 415. I always get an error 500.
>
> BTW, there is nothing in the log files what helps me to figure out
> what is going on.
>
> Any idea? What did I miss?
>
> Best,
>
> Oliver
>
>