users@glassfish.java.net

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

From: Oliver B. Fischer <mailsink_at_swe-blog.net>
Date: Thu, 22 Aug 2013 17:16:09 +0200

Hi Pavel,

The testcase is available at
https://bitbucket.org/obfischer/glassfish-restproblem/src

Simply clone it and execute Maven

git clone git_at_bitbucket.org:obfischer/glassfish-restproblem.git
cd glassfish-restproblem
mvn

This will build the project and run all tests against GF 3.1.2.2. To
execute it with GF 4 simple change the Maven property
dep.glassfish.version from 3.1.2.2 to 4.0

The project also builds an ear you can deploy in GF 3 and GF 4. The
directory scripts contains a tiny shell script to send an JSON document
to the REST interface.

Best,

Oliver

Am 22.08.13 10:54, schrieb Pavel Bucek:
> On 8/21/13 11:26 PM, Oliver B. Fischer wrote:
>> Hi Pavel,
>>
>> I set the property, but still get an 500 without any trace in the log
>> files.
>>
>> Thanks for the hint with the logger. I can now see the registered
>> providers. My one is also listet. Does the order matter?
>
> yes, but if and only if there is exactly same provider in terms of
> effective media type and java type. Is any of your provider method
> invoked during request processing? What is in Accept header in your
> request? Which media type is produced by your resource method? Do you
> have any @Produces/_at_Consumes annotations on your provider?
>
> Can you extract minimal reproducible testcase and share it? It will be
> far more efficient.. :)
>
> Pavel
>
>>
>> Best,
>>
>> Oliver
>>
>>
>>
>> Am 21.08.13 15:47, schrieb Pavel Bucek:
>>> 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>
>>
>>
>