users@jersey.java.net

Re: [Jersey] ClassNameResourceConfig.PROPERTY_CLASSNAMES ignored with Grizzly Web and EmbeddedGlassFish test containers

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 13 Oct 2009 13:09:57 +0200

On Oct 13, 2009, at 1:03 PM, Naresh wrote:

> Paul Sandoz wrote:
>>
>> On Oct 13, 2009, at 12:12 PM, Naresh wrote:
>>
>>> Hi Paul,
>>>
>>> that commit had fixed the problem with transformation.
>>>
>>
>> Ah, got the wrong end of the stick!
>>
>>
>>> But, in my case I'm working with WebAppDescriptor (test), and see
>>> that the property PROPERTY_CLASSNAMES is ignored and
>>> ClasspathResourceConfig is initialized when I try using the Grizzy
>>> Web test container type.
>>>
>>
>> When using the Web layer it attempts to look in certain well known
>> directories of the Web app, namely WEB-INF/lib and WEB-INF/classes.
>> The trouble is this approach is not very portable, so we might be
>> hitting an issue w.r.t embedded GF and a limitation in Grizzly's
>> servlet support.
> Agree.
>>
>> It may also be related to the way the tests are built, do the
>> following directories exist?
> No. They don't exist.

Ah, that is the problem :-)

Do they exist in another location?

I do not know the structure of the tests but if these tests do not
have standard layout as if they were deployed to a web app server then
the default class scanning support (when no init-params are supplied)
will not work.


>>
>> /home/naresh/workspace/tango/qe-tests/jersey-tests/core-tests/
>> coretest2/WEB-INF/lib
>> /home/naresh/workspace/tango/qe-tests/jersey-tests/core-tests/
>> coretest2/WEB-INF/classes
>>
>>
>>> The test in the attached zip file shows the behavior, just unzip
>>> it and do *mvn test*.
>>>
>>
>> I have no time to investigate at the moment, can you debug into
>> Jersey and try and find the reason why the following is logged?
> Sure. I'll try to do that. Is there a way where we can set the log
> levels to FINEST, so that we can see what really is happening
> internally?
>

You need to read up on JDK logging to do that, but i am not sure it
will help much.

If you can load up the test in NBs and run it in debug mode that might
be easier.

Paul.