users@glassfish.java.net

[gf-users] Re: Why isn't my _at_InstanceResolverAnnotation being used in Glassfish 3.1.2?

From: Lukas Jungmann <lukas.jungmann_at_oracle.com>
Date: Thu, 05 Jun 2014 21:47:41 +0200

On 6/5/14, 8:48 PM, Dan Kaplan wrote:
> I looked around in the source and found this line in
> the org.glassfish.webservices.WSServletContextListener:
>
> // See if it is configured with JAX-WS extension
> InstanceResolver annotation like
> // @com.sun.xml.ws.developer.servlet.HttpSessionScope or
> @com.sun.xml.ws.developer.Stateful
> InstanceResolver ir =
> InstanceResolver.createFromInstanceResolverAnnotation(serviceEndpointClass);
> //TODO - Implement 109 StatefulInstanceResolver ??
> if (ir == null) {
> //use our own InstanceResolver that does not call
> @PostConstuct method before
> //_at_Resource injections have happened.
> ir = new InstanceResolverImpl(serviceEndpointClass);
> }
> Invoker inv = ir.createInvoker();
>
> The name of that class concerns me. It's called
> WSServletContextListener, but my Web Services are EJBs, not servlets.

It doesn't matter, even ejb endpoints are implemented as servlets behind
the scenes (jsr-109 can give you more in depth view on this)

> Does this mean that the @InstanceResolverAnnotation is only
> considered if my Web Services are EJBs?

No, if you're getting 'null' from
InstanceResolver.createFromInstanceResolverAnnotation(serviceEndpointClass);
I'd put a breakpoint on this line, check that serviceEndpointClass
contains expected annotation and start debugging from here
(InstanceResolver source is in jaxws-ri[1]) if something is wrong.

thanks,
--lukas

[1]:
https://github.com/gf-metro/jaxws/blob/master/jaxws-ri/rt/src/main/java/com/sun/xml/ws/api/server/InstanceResolver.java
>
>
> On Wed, Jun 4, 2014 at 3:40 PM, Dan Kaplan <dank_at_mirthcorp.com
> <mailto:dank_at_mirthcorp.com>> wrote:
>
> You can find the source code I'm using here:
> https://java.net/projects/jax-ws-commons/sources/svn/show/trunk/guice/src/main/java/org/jvnet/jax_ws_commons/guicemanaged
>
>
> Why doesn't the GuiceManagedInstanceResolver get used? I can
> easily hit breakpoints in the GuiceManagedFeature, but not
> the GuiceManagedInstanceResolver. Is
> com.sun.xml.ws.api.server.InstanceResolverAnnotation ignored now?
> What was it replaced with?
>
> --
> Thanks,
> Dan
>
>
>
>
> --
> Thanks,
> Dan
>
> CONFIDENTIALITY NOTICE: The information contained in this electronic
> transmission may be confidential. If you are not an intended
> recipient, be aware that any disclosure, copying, distribution or use
> of the information contained in this transmission is prohibited and
> may be unlawful. If you have received this transmission in error,
> please notify us by email reply and then erase it from your computer
> system.