openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "l.penet@senat.fr" <l.pe...@senat.fr>
Subject Re: Testing a REST service implemented using Jersey 2.17 and OWB 1.2.17
Date Thu, 07 May 2015 10:42:13 GMT
On 07/05/2015 10:45, l.penet@senat.fr wrote:
> On 06/05/2015 21:06, Mark Struberg wrote:
>> Hi Ludovic!
>>
>> Not quite sure where you did put your openwebbeans libraries. Cananot 
>> find them in your dependency tree.
> Sorry, here is the right one :
Dear all,

digging a bit further, I found that the issue seems to be a problem of 
Jersey/OpenWebBeans configuration. It is not test related, as we have 
the same problem when performing a request with the webapp running normally.

Jersey does not seem to "find" OWB when it tries to perform injection in 
as service if I understand well the following three exceptions :

AVERTISSEMENT: The following warnings have been detected: WARNING: 
Unknown HK2 failure detected:
MultiException stack 1 of 3
org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no 
object available for injection at 
SystemInjecteeImpl(requiredType=PresencesUtils,parent=ActivitesRestService,qualifiers={},position=-1,optional=false,self=false,unqualified=null,183002184)
     at 
org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:74)
     at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:214)
     at 
org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:237)
     at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:360)
     at 
org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
     at 
org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:162)
     at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2064)
     at 
org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:711)
     at 
org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:653)
     at 
org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:169)
     at 
org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185)
     at 
org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:74)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:109)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:92)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:61)
     at 
org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
     at 
org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:297)
     at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
     at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
     at 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
     at 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:288)
     at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1110)
     at 
org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:381)
     at 
org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:219)
     at 
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
     at 
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
     at java.lang.Thread.run(Thread.java:745)
MultiException stack 2 of 3
java.lang.IllegalArgumentException: While attempting to resolve the 
dependencies of fr.senat.presences.rest.api.v1.ActivitesRestService 
errors were found
     at 
org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:249)
     at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:360)
     at 
org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
     at 
org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:162)
     at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2064)
     at 
org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:711)
     at 
org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:653)
     at 
org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:169)
     at 
org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185)
     at 
org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:74)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:109)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:92)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:61)
     at 
org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
     at 
org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:297)
     at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
     at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
     at 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
     at 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:288)
     at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1110)
     at 
org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:381)
     at 
org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:219)
     at 
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
     at 
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
     at java.lang.Thread.run(Thread.java:745)
MultiException stack 3 of 3
java.lang.IllegalStateException: Unable to perform operation: resolve on 
fr.senat.presences.rest.api.v1.ActivitesRestService
     at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:389)
     at 
org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
     at 
org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:162)
     at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2064)
     at 
org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:711)
     at 
org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:653)
     at 
org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:169)
     at 
org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185)
     at 
org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:74)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:109)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:92)
     at 
org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:61)
     at 
org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
     at 
org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:297)
     at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
     at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
     at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
     at 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
     at 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:288)
     at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1110)
     at 
org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:381)
     at 
org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:219)
     at 
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
     at 
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
     at java.lang.Thread.run(Thread.java:745)


I am using Jersey 2.17 and OWB 1.2.17. Do you know of a working example 
that I could analyse ?

We tried to mimick what is recommended for Weld.

So, we declared :
* declared a resource : context.xml

   <Resource name="BeanManager"
         auth="Container"
         type="javax.enterprise.inject.spi.BeanManager"
         factory="org.apache.webbeans.container.ManagerObjectFactory" />

And a resource-env-ref in web.xml

     <resource-env-ref>
<resource-env-ref-name>BeanManager</resource-env-ref-name>
<resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
     </resource-env-ref>


We tried to explicitely add the listener in web.xml :

     <listener>
<listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
     </listener>


However, this last seems to me pretty much useless as OWB is properly 
bootstrapped, according to the logs, and according to the fact that I 
can inject beans at other places.

Thanks in advance,

Ludovic
|
| AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
|


Mime
View raw message