users@jersey.java.net

Re: [Jersey] Re: tomcat, classloaders and _at_Providers problem

From: Robert Koberg <rob.koberg_at_gmail.com>
Date: Tue, 2 Feb 2010 06:54:27 -0800

On Feb 2, 2010, at 2:40 AM, Paul Sandoz wrote:

> Hi Robert,
>
> Can you send me:
>
> - the web.xml
>
> - the code of your Provider (including the package declaration)
>
> - and the full output log from the app server
>
> ?
>
>
> I am not sure if there is a class loader issue here or a config issue. When Jersey scans for classes it will use ASM to load the class file byte code and look for annotations.
>
> If there is a class file annotated with @Provider that is within the scope of a scan it should get detected and the class will be loaded, or a class loading error will result.


uff... well, I just put together a simple test web app and it found the provider in the app. I was definitely seeing the problem yesterday, so I probably have something else causing the problem in my app.

Sorry for the bother,
-Rob


>
> Paul.
>
> On Feb 1, 2010, at 5:57 PM, Robert Koberg wrote:
>
>> Another note on this: If you use your own custom javax.ws.rs.Application, the provider can be pulled from the web app.
>>
>> best,
>> -Rob
>>
>>
>> On Feb 1, 2010, at 6:08 AM, Robert Koberg wrote:
>>
>>> Hi,
>>>
>>> java 1.6.0_17
>>> tomcat 6.0.24
>>> jersey-1.1.5
>>>
>>> * placed my jersey jars in $tomcat/lib.
>>> * created custom javax.ws.rs.ext.Provider and resource classes in my web app ($app/WEB-INF/lib).
>>> * using 'com.sun.jersey.config.property.packages' and give it the packages of Jackson's jaxrs (that live in $tomcat/lib) and my provider and resources (that live in $app/WEB-INF/lib).
>>>
>>> Jersey does its scan at server start and finds my resource classes and the Jackson providers, but not my web app's provider. If I place my provider in the $tomcat/lib it is found by the scan.
>>>
>>> Is this a fact of life or a bug? Does this happen on other servlet containers? I was going to move the provider to the server lib dir anyway, so it is not really a problem for me, but it is unexpected.
>>>
>>> best,
>>> -Rob
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>