Skip to main content

How do I get a @InstanceResolverAnnotation to be used in Glassfish 3.1.2?

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2014-06-04

I'm trying to follow this blog post here: (the library source can be seen here: )

This is mostly working, but the key missing part is that the GuiceManagedInstanceResolver doesn't ever get used. It's an AbstractMultiInstanceResolver and it's referred to in an annotation like this:


import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

From and

I would have used but apparently it doesn't work with guice 3.0
@WebServiceFeatureAnnotation(id = GuiceManagedFeature.ID, bean = GuiceManagedFeature.class)
public @interface GuiceManaged {
public Class<? extends Module>[] module();

If I put that annotation on a @WebService, the GuiceManagedFeature gets used, but the GuiceManagedInstanceResolver never gets called. This source code is ~5 years old so I figure maybe something has changed where @InstanceResolverAnnotation isn't considered anymore? Should I use an annotation other than @InstanceResolverAnnotation? Has it been replaced with a different annotation? Is there a different way to do this now?