Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-2524

@EJB injection into @Service bean leads to NullPointerException when injected bean is redepolyed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EAP 5.0.1.CR1
    • EAP 5.0.0.BETA
    • EJB
    • None
    • Workaround Exists
    • Hide

      Annotating the "A" interface with @LocalBinding and setting "B" injected mappedName to this value allows redeployment of "A". However, "B"'s lifecycle will no longer be tied to "A". That is, "B" will not stop when you undeploy "A"

      Show
      Annotating the "A" interface with @LocalBinding and setting "B" injected mappedName to this value allows redeployment of "A". However, "B"'s lifecycle will no longer be tied to "A". That is, "B" will not stop when you undeploy "A"

      I have two @Service jars, service "A" and "B" where "B" injects an instance of "A" using the @EJB annotation with a mappedName attribute set to the default jndi location of A ("EJBTestAService/local" in the example provided.) When deployed, they work fine. But, if "A" is redeployed, access to "B" fails due to a NullPointerException, the reference to "A" is null. See EJBTHREE-1889 for code to reproduce.

            rhn-engineering-cdewolf Carlo de Wolf
            rhn-support-miclark Mike Clark
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: