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

Inherited EJBs in JSF ManagedBeans are not being injected

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: EAP_EWP 5.1.1
    • Fix Version/s: EAP_EWP 5.1.2 ER1
    • Component/s: Web
    • Labels:
      None
    • Environment:

      JBoss Enterprise Application Platform 5.1.1
      JSF 1.2
      EJB3 1.3.7

    • Steps to Reproduce:
      Hide

      An example application is attached.
      1.Deploy it to EAP 5.1.1
      2.Access the Web Application at http://localhost:8080/TestEARWeb/

      EXPECTED:
      "Hello the Thing!" is printed to the browser

      ACTUAL:
      java.lang.NullPointerException
      com.redhat.gss.example.web.controller.AbstractController.getThing(AbstractController.java:19)

      Show
      An example application is attached. 1.Deploy it to EAP 5.1.1 2.Access the Web Application at http://localhost:8080/TestEARWeb/ EXPECTED: "Hello the Thing!" is printed to the browser ACTUAL: java.lang.NullPointerException com.redhat.gss.example.web.controller.AbstractController.getThing(AbstractController.java:19)
    • Workaround Description:
      Hide

      Move one of the fields annotated with @EJB into the concreated ManagedBean. Alternatively if we add another annotation, such as @Resource, to the concrete class all the annotations from the subclass will also be processed.

      Show
      Move one of the fields annotated with @EJB into the concreated ManagedBean. Alternatively if we add another annotation, such as @Resource, to the concrete class all the annotations from the subclass will also be processed.
    • Release Notes Text:
      Hide
      The injection of @EJB or @Resource fields into superclasses of JSF Managed Bean were failing. When @EJB were to be injected via annotations, those annotations were not being processed, leaving their fields null, or otherwise unset. The cause of this issue has been resolved and these injections now work as expected.
      Show
      The injection of @EJB or @Resource fields into superclasses of JSF Managed Bean were failing. When @EJB were to be injected via annotations, those annotations were not being processed, leaving their fields null, or otherwise unset. The cause of this issue has been resolved and these injections now work as expected.
    • Release Notes Docs Status:
      Documented as Resolved Issue
    • Docs QE Status:
      NEW

      Description

      When a JSF ManagedBean inherits EJB fields from a superclass, those EJBs are not being injected into the ManagedBean. If we place any annotation in the concrete ManagedBean implementation, then @EJB annotations from the superclass are picked up. For example if we move one of the fields annotated with @EJB into the concreated ManagedBean, or add a @Resource annotation, the problem does not occur.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jaikiran Jaikiran Pai
                Reporter:
                jshepher Jason Shepherd
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: