users@jersey.java.net

[Jersey] Re: jersey-guice-filter GuiceFilterTest in 1.4

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 30 Dec 2010 12:49:59 +0100

On Dec 19, 2010, at 11:39 PM, Bill de hÓra wrote:

> tried it with GrizzlyWebTestContainerFactory on the classpath and it
> worked.
>
> protected TestContainerFactory getTestContainerFactory() {
> return new GrizzlyWebTestContainerFactory();
> }
>
> I wonder if Builder.contextListenerClass should throw an exception
> if the TCF is inmemory or httpcontainer?
>

Yes, we need to improve the constraint checking and error reporting
when transforming a WebAppDescriptor into a LowLevelDescriptor. There
is an issue already open:

   http://java.net/jira/browse/JERSEY-591


However, I am not quite sure why you are getting this:

>> WARNING: Found multiple TestContainerFactory implementations, using
>> com.sun.jersey.test.framework.spi.container.http.HTTPContainerFactory



Specifically why the LW HTTP test container using the LW HTTP server
as shipped with SE 6 is taking precedence over Grizzly.

How did you run the test?

Paul.





> Bill
>
>
>
> On Sun, 2010-12-19 at 20:40 +0000, Bill de hÓra wrote:
>> Hi,
>>
>> I'm trying to run the GuiceFilterTest as is from
>>
>> http://download.java.net/maven/2/com/sun/jersey/samples/guicefilter-webapp/1.4/
>>
>> Is there some other setup I need to do first? It does not appear to
>> be using the supplied filterClass or contextListenerClass passed
>> into the Builder. I get this
>>
>> {{{
>> 19-Dec-2010 20:35:54 com.sun.jersey.test.framework.JerseyTest
>> getDefaultTestContainerFactory
>> WARNING: Found multiple TestContainerFactory implementations, using
>> com.sun.jersey.test.framework.spi.container.http.HTTPContainerFactory
>> 19-Dec-2010 20:35:54 com.sun.jersey.api.core.PackagesResourceConfig
>> init
>> INFO: Scanning for root resource and provider classes in the
>> packages:
>> com.sun.jersey.samples.guice.resources
>> 19-Dec-2010 20:35:54 com.sun.jersey.api.core.ScanningResourceConfig
>> logClasses
>> INFO: Root resource classes found:
>> class com.sun.jersey.samples.guice.resources.PerRequestResource
>> 19-Dec-2010 20:35:54 com.sun.jersey.api.core.ScanningResourceConfig
>> init
>> INFO: No provider classes found.
>> 19-Dec-2010 20:35:54
>> com
>> .sun.jersey.test.framework.spi.container.http.HTTPContainerFactory
>> $HTTPTestContainer <init>
>> INFO: Creating low level http container configured at the base URI http://localhost:9998/
>> 19-Dec-2010 20:35:54
>> com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
>> INFO: Initiating Jersey application, version 'Jersey: 1.4
>> 09/11/2010 10:30 PM'
>>
>> com.sun.jersey.spi.inject.Errors$ErrorMessagesException
>> at
>> com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:
>> 170)
>> at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:137)
>> at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:
>> 203)
>> at
>> com
>> .sun
>> .jersey
>> .server
>> .impl
>> .application.WebApplicationImpl.initiate(WebApplicationImpl.java:695)
>> at
>> com
>> .sun
>> .jersey
>> .api
>> .container.ContainerFactory.createContainer(ContainerFactory.java:
>> 172)
>> at
>> com
>> .sun
>> .jersey
>> .api
>> .container.ContainerFactory.createContainer(ContainerFactory.java:
>> 134)
>> at
>> com
>> .sun.jersey.test.framework.spi.container.http.HTTPContainerFactory
>> $HTTPTestContainer.<init>(HTTPContainerFactory.java:105)
>> at
>> com
>> .sun
>> .jersey
>> .test
>> .framework
>> .spi
>> .container
>> .http.HTTPContainerFactory.create(HTTPContainerFactory.java:75)
>> at
>> com
>> .sun.jersey.test.framework.JerseyTest.getContainer(JerseyTest.java:
>> 338)
>> at com.sun.jersey.test.framework.JerseyTest.<init>(JerseyTest.java:
>> 213)
>> at
>> com
>> .sun
>> .jersey.samples.guice.GuiceFilterTest.<init>(GuiceFilterTest.java:55)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>> at
>> sun
>> .reflect
>> .NativeConstructorAccessorImpl
>> .newInstance(NativeConstructorAccessorImpl.java:39)
>> at
>> sun
>> .reflect
>> .DelegatingConstructorAccessorImpl
>> .newInstance(DelegatingConstructorAccessorImpl.java:27)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>> at
>> org
>> .junit
>> .runners
>> .BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:168)
>> at org.junit.runners.BlockJUnit4ClassRunner
>> $1.runReflectiveCall(BlockJUnit4ClassRunner.java:213)
>> at
>> org
>> .junit
>> .internal
>> .runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>> at
>> org
>> .junit
>> .runners
>> .BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:210)
>> at
>> org
>> .junit
>> .runners
>> .BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
>> at
>> org
>> .junit
>> .runners
>> .BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
>> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
>> at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
>> at
>> org
>> .junit
>> .internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>> at
>> org
>> .junit
>> .internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>> at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>> at org.junit.runner.JUnitCore.run(JUnitCore.java:159)
>> at
>> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:
>> 65)
>>
>> 19-Dec-2010 20:35:55 com.sun.jersey.spi.inject.Errors
>> processErrorMessages
>> SEVERE: The following errors and warnings have been detected with
>> resource and/or provider classes:
>> SEVERE: Missing dependency for constructor public
>> com
>> .sun
>> .jersey
>> .samples
>> .guice
>> .resources
>> .PerRequestResource
>> (com.sun.jersey.samples.guice.resources.SingletonComponent) at
>> parameter index 0
>> }}}
>>
>> Bill
>>
>>
>>
>>
>