users@jersey.java.net

[Jersey] Re: JerseyTest and Guice

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Sun, 20 Mar 2011 19:44:11 -0700 (PDT)

Gili wrote:
>
> It looks like Jersey's classpath scanner is looking in the wrong place.
> Here is what I see when running unit tests:
>
> INFO: Scanning for root resource and provider classes in the paths:
> C:\Users\Gili\Documents\foo\WEB-INF\lib
> C:\Users\Gili\Documents\foo\WEB-INF\classes
>
> Here is what I see when running the project:
>
> INFO: Scanning for root resource and provider classes in the paths:
> C:\Users\Gili\Documents\foo\target\com.foo\WEB-INF\lib
> C:\Users\Gili\Documents\foo\target\com.foo\WEB-INF\classes
>
> The paths referenced by the unit test do not exist (notice even the
> "target" directory is missing). Where is it getting those paths from?
>
> Thanks,
> Gili
>

Found it. The Javadoc for ServletContainer say that if
"ClasspathResourceConfig.PROPERTY_CLASSPATH" init parameter is not
specified, Jersey will try using web-inf/classes and web-inf/lib. I
specified ClasspathResourceConfig.PROPERTY_CLASSPATH and now the classes are
being found.

Thanks,
Gili

--
View this message in context: http://jersey.576304.n2.nabble.com/Re-Re-Jersey-JerseyTest-and-Guice-tp5675712p6191042.html
Sent from the Jersey mailing list archive at Nabble.com.