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

NullPointerException when attempting to get an InjectionTarget for an Interface Class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.0.CR1
    • None
    • None
    • None

      Simple enough to reproduce...

      AnnotatedType<?> annotatedType = beanManager.createAnnotatedType(serviceType);
      InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);

      Where serviceType is an Interface Class. A NPE results on the following call to createInjectionTarget because serviceType has no constructors....

      java.lang.NullPointerException
      at org.jboss.weld.util.Beans.getPostConstructMethods(Beans.java:246)
      at org.jboss.weld.manager.SimpleInjectionTarget.<init>(SimpleInjectionTarget.java:85)
      at org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1006)
      at org.switchyard.cdi.ServiceDeployer.addInjectableClientProxyBean(ServiceDeployer.java:86)

              pmuiratbleepbleep Pete Muir (Inactive)
              tfennelly_jira Tom Fennelly (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: