2 Replies Latest reply on May 13, 2011 7:18 AM by Gábor Farkas

    WELD-001308 Unable to resolve managed beans for Types when CDI injecting from a separate jar (Glassfish)

    jiijo jannej Newbie

      Using Glassfish 3.0.1

      II have a MDB which I am injecting some beans into using CDI. I try to
      inject MyInjectedBean. MyInjectedBean comes from a separate JAR. I
      have added proper beans.xml to this jar's META-INF.

      Injecting beans from the same EJB jar works fine. I can also create
      MyInjectedBean manually with new() so my MDB can access the classes.

      My packet structure is this way:

      - ejb.jar
      - some.jar

      MDB is in ejb.jar and MyInjectedBean is inside some.jar

      public class MyMdbBean implements MessageListener {
         private MyInjectedBean myBean;

      org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308
      Unable to resolve managed beans for Types: [class com.MyInjectedBean];
       Bindings: [@javax.enterprise.inject.Default()]
             at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:807)
             at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:793)
             at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:108)
             at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:790)
             at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:802)