Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-5079

Ejb bean injection between multiple Ejb module

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.3.0.Final
    • Fix Version/s: None
    • Component/s: EJB3
    • Labels:
    • Environment:

      JBoss 7.1.1
      Seam 2.3

    • Steps to Reproduce:
      Hide
      • MyEar.ear
        • MyEjb1.jar
          • MySLSB.class
        • MyEjb2.jar
          • MySeamComponent.class
        • MyWar.war

      Inject from MySeamComponent the MySLSB

      Show
      MyEar.ear MyEjb1.jar MySLSB.class MyEjb2.jar MySeamComponent.class MyWar.war Inject from MySeamComponent the MySLSB
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      One possible Workaround is that we can remove the EJB annotations. This way Seam can inject the bean correctly.

      Show
      One possible Workaround is that we can remove the EJB annotations. This way Seam can inject the bean correctly.

      Description

      I'm trying to inject SLSB-s between multiple EJB module/project. These SLSBs are also Seam components (therefore they have both @Name and @Stateless annotation + @Local).

      The problem is that each time i want to inject a Bean from another project/module, Seam predicts that the component is under the module from where i inject.

      Consider the following:

      • MyEar.ear
        • MyEjb1.jar
          • MySLSB.class
        • MyEjb2.jar
          • MySeamComponent.class
        • MyWar.war

      Here i want to inject the MySLSB from the MySeamComponent. However they both belong to separate modules. Behind the curtain Seam predicts that the MySLSB is under the MyEjb2 module. Altough its not.

      Exception:

      Caused by: javax.naming.NameNotFoundException: MyEjb2/MySLSB – service jboss.naming.context.java.app.MyEar.MyEjb2.MySLSB
      at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)
      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)
      at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:123)
      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)
      at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_21]
      at org.jboss.seam.Component.instantiateSessionBean(Component.java:1407) [jboss-seam.jar:2.3.0.Final]
      at org.jboss.seam.Component.instantiate(Component.java:1370) [jboss-seam.jar:2.3.0.Final]
      at org.jboss.seam.Component.newInstance(Component.java:2186) [jboss-seam.jar:2.3.0.Final]

      I'm aware of that from JBoss v7 each beans are binded to a separate namespaces if they are belong to separate modules. Altough im not sure this is the default behaviour if the modules are not isolated (ear-subdeployments-isolated = false).

      Any suggestion is warmly welcome.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                r0nan Karoly Torok
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: