users@jersey.java.net

Re: [Jersey] Jersey trouble under glassfish 3

From: Morten <mortench2004_at_yahoo.dk>
Date: Thu, 22 Apr 2010 07:01:30 -0700 (PDT)

Hi Poul, Many thanks for your quick answer. See my comments inline below: > You may be running into: > >   https://jersey.dev.java.net/issues/show_bug.cgi?id=423 > > which was fixed in 1.1.5. GF v3 ships with 1.1.4.1. > > Hard to say why without looking at code, can you send me a > reproducible test case? I do not think this is the problem I have run into. I did finally found out very late last night that the reason resources was not getting injected was that I only put the annotation "javax.inject.Singleton" on my controller base class and not the controllers themselves. Apparently, it is not inherited so after I moved the annotation from base class to all the controller subclasses it worked. However, I still get the same exception from Jersey in the and I am not yet sure yet why it happens and what impact it has? The project in question is quite large but I will try to see if I can reproduce it in a small test case for you. I will get back to you on that. > > P.S. I tried to look in the source for > JCDIComponentProviderFactory in the glassfish's jersey osgi > bundle but could not find the source unlike for other jersey > modules?? > > > > Yes, the sources are not pushed for that (it is an error). > The Java source is the same as the jersey-bundle: > >   http://download.java.net/maven/2/com/sun/jersey/jersey-bundle/1.1.5.1/jersey-bundle-1.1.5.1-sources.jar Thanks. I will look in the sources also. BTW: Is there a way to update glassfish 3.0 to use the latest jersey jar ? > It looks like there is more than one reference available > for the an "annotated type" of an injection target: > >   com.myapp.ws.controller.ServiceController, >   com.myapp.ws.controller.MyController, >   com.myapp.ws.controller.ControllerBase, >   com.myapp.ws.controller.GuiController, >   com.myapp.ws.controller.AdminController > > and the Set<Bean<?>> of the above cannot be > resolved to one Bean<?> instance and thus Jersey does > not know how to adapt the injection target for it's own > injection. So Jersey prints logs an error, perhaps it should > not and instead should ignore. Yes, the problem is that I do not have any reference to another controller in my code, so I have no idea where this ambiguous set is from... I do suspect its inside the CDI-Jersey integration though ? > Again seeing more code, preferably a test case would help > me work out better what is going on. It is non-trivial to produce but I will see what I can do (unless you have a clear idea where in CDI-jersey the ambiguous set is used ?) Thanks, Morten