Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-271

Resource injection ends up searching for wrong target method when a resource type is specified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.Beta3
    • 7.0.0.Beta2
    • EE
    • None

      Consider either of the following examples:

      @Resource (type=ChildClass.class)
      public void setSomeValue(ParentClass b);
      
      
      @EJB (beanInterface=SpecificBeanClassImpl.class)
      public void setSomeEjb(ParentClass b);
      

      The resource injection framework ends up searching for an (incorrect) method whose paramtype is ChildClass/SpecificBeanImplClass and doesn't find such a method. As a result, the deployment fails with exception like:

      Caused by: java.lang.IllegalArgumentException: Invalid injection - Method void setSomeEjb(SpecificBeanImplClass) not found on class blah.blah.SomeClass
      	at org.jboss.as.ee.component.ResourceInjection$Factory.create(ResourceInjection.java:88)
      	at org.jboss.as.ee.component.JndiInjectionPointStore.applyInjections(JndiInjectionPointStore.java:98)
      	at org.jboss.as.ee.component.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:206)
      	at org.jboss.as.ee.component.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:67)
      	... 5 more
      
      

              jaikiran Jaikiran Pai (Inactive)
              jaikiran Jaikiran Pai (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: