Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-246

Cannot add a custom bean from a portable extension.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 1.0.0.GA
    • 1.0.0.CR1
    • None
    • None

      Adding a CustomBean using the AfterBeanDiscovery doesnt seem to work. The portable extension defines an interface (and a bean class that implements it) and tries to inject an instance of the interface to the servlet implementation. But it fails with the following extension.

      Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: interface
      org.glassfish.test299.ABeanInterface; binding types = [@Default]Unable to resolve any Managed Beans
      at org.jboss.weld.BeanManagerImpl.getBean(BeanManagerImpl.java:996)
      at org.jboss.weld.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:966)
      at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:78)
      at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:683)
      at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:695)
      at org.jboss.weld.SimpleInjectionTarget$1.proceed(SimpleInjectionTarget.java:108)
      at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:123)
      at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:47)
      at org.jboss.weld.SimpleInjectionTarget.inject(SimpleInjectionTarget.java:102)
      at org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:174)
      at
      com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBe
      an(ManagedBeanManagerImpl.java:456)
      at
      com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBe
      an(ManagedBeanManagerImpl.java:423)
      at
      com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionM
      anagerImpl.java:295)

      I have attached a test case with glassfish issue here.
      https://glassfish.dev.java.net/issues/show_bug.cgi?id=10658

            rogerk_jira Roger Kitain (Inactive)
            binodpg Binod PG (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: