users@jersey.java.net

Re: [Jersey] Problems with test framework

From: bea <beaotx_at_gmail.com>
Date: Thu, 20 Aug 2009 14:13:47 +0200

Hi,

I'm making some progress.
First I tested the helloworld-webapp with maven 2.0.9 and it worked. Then I
tried my app after changing the instantiate way of my test construct (it was
wrong). With EmbeddedGF as container.type, it seems that works, at least
requesting the wadl. But I've another tests that fails because of an 500
error:


GRAVE: StandardWrapperValve[DataChannel Jersey Webapp]: PWC1406:
Servlet.service() for servlet DataChannel Jersey Webapp threw exception
java.lang.RuntimeException: javax.naming.NamingException: Invocation
exception: Got null ComponentInvocation
        at
cc.common.server.datachannel.entities.service.PersistenceService.<init>(PersistenceService.java:32)
        at
cc.common.server.datachannel.entities.service.PersistenceService.<init>(PersistenceService.java:13)
        at
cc.common.server.datachannel.entities.service.PersistenceService$1.initialValue(PersistenceService.java:19)
        at
cc.common.server.datachannel.entities.service.PersistenceService$1.initialValue(PersistenceService.java:16)
        at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:141)
        at java.lang.ThreadLocal.get(ThreadLocal.java:131)
        at
cc.common.server.datachannel.entities.service.PersistenceService.getInstance(PersistenceService.java:42)
        at
cc.common.server.datachannel.resources.OperadoresResource.get(OperadoresResource.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:156)
        at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
        at
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:166)
        at
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:74)
        at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:114)
        at
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:66)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:709)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:667)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:658)
        at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:318)
        at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425)
        at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:604)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
        at
org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:462)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)


It seems that the persistence layer isn't being created correctly in the
Glassfish embedded. Do you know why?

Thanks



On Thu, Aug 20, 2009 at 11:33 AM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:

>
> On Aug 19, 2009, at 2:31 PM, bea wrote:
>
> You have a typo:
>
> mvn clean test -Dcontainer.type=EmbbededGF -DenableLogging
>>
> ^
> |
> EmbeddedGF
>
>
> I tried with the version 1.1.1-ea of the hello world web app using the
> correct name and it worked fine:
>
> # mvn -version
> Maven version: 2.0.9
> Java version: 1.6.0_13
> OS name: "mac os x" version: "10.5.7" arch: "x86_64" Family: "mac"
>
>
>
> Perhaps you can download the following:
>
>
> http://download.java.net/maven/2/com/sun/jersey/samples/helloworld-webapp/1.1.1-ea/helloworld-webapp-1.1.1-ea-project.zip
>
> and try doing:
>
> mvn clean test -Dcontainer.type=EmbeddedGF -DenableLogging
>
> or:
>
> mvn clean test -Dcontainer.type=GrizzlyWeb -DenableLogging
>
>
> and see if you get the same error.
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>