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 15:47:03 +0200

please see
https://jersey.java.net/apidocs/latest/jersey/javax/ws/rs/core/Application.html#getProperties()

in short - if you are working with Application (or ResourceConfig)
directly, you can set it there, if not, use init or context param,
something like:


     <servlet>
         ...
         <init-param>
<param-name>jersey.config.workers.legacyOrdering</param-name>
             <param-value>true</param-value>
         </init-param>
         ...
     </servlet>


Regards,
Pavel

On 8/21/13 2:31 PM, Oliver B. Fischer wrote:
> Hi Pavel,
>
> how can I set this property? Never hit this.. ;)
>
> Bye,
>
> Oliver
>
>
> Am 21.08.13 13:43, schrieb Pavel Bucek:
>> 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
>>>
>>>
>>
>