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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.0.0.Beta2
    • Fix Version/s: 7.0.0.Beta3
    • Component/s: EE
    • Labels:
      None

      Description

      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
      
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jaikiran Jaikiran Pai
                Reporter:
                jaikiran Jaikiran Pai
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: