1 Reply Latest reply on Jun 28, 2013 6:56 PM by Hector Mendoza

    EJB Module & Seam 2.2: @In attribute requires non-null value

    meinereiner85 Newbie

      Hi all,

       

      I'm struggling around here for a couple of days with a probably simple issue:

       

      What I want to do:

      I habe a web application and an EJB module which contains certain EJBs (like Enity beans, ...) and some Seam Components and sometimes also combinations of stateless EJBs and Seam components. All two parts I want to put together to one EAR. All in all I'm first looking to the smallest subset: simple Seam components in an EJB module packet together in one jar.

       

      The Seam components (excluding EJBs) work perfectly when they are in the web application itself or in a JAR file that is directly embedded into the web application (JAR in WEB-INF/lib).

       

      But when I try to move those Seam components to the EJB module they cannot be loaded. I only get "@In attribute requires non-null value".

       

      How it looks now:

      EAR - application.xml:

           The jboss-seam.jar, the EJB module ("mylib.jar") and the webapp.war are listed here.

      webapp.war :

           mylib.jar is referenced as build library

           Adapted the jndiPattern to java:module/#{ejbName} which is referenced by the components.xml

      mylib.jar:

           Contains a seam.properties (empty) under ejbModule (src-root)

           Contains a META-INF/ejb-jar.xml with SeamInterceptor

       

       

       

      I can see that EJBs are loaded properly from the EJB module jar but no seam components are regognised.

       

      What I already did:

      - I've tried different variations of JNDI pattern but I think this doesn't matter

      - I've successfully tested it if I put one jar only with seam components directly in the WEB-INF/lib folder

      - Another approach was to add the Seam components via components.xml. In fact that worked out better, but I had the issue that I was "Attempt to invoke a Seam component outside an initialized application".

       

      I've read in multiple forum entries that this should be possible but I do not know what I do wrong. Has someone some hints for me to look into?

       

      meinereiner   

        • 1. Re: EJB Module & Seam 2.2: @In attribute requires non-null value
          Hector Mendoza Newbie

          We have an app like yours, our app had this structure:

          ear

               war

               ejb1.jar (with META-INF/ejb-jar.xml and seam.properties)

               ...

               ejb6.jar

               /META-INF/application.xml,jboss-app.xml

           

          So it should work, maybe a configuration in the xml's, this is how ejb-jar.xml looks like:

           

            <interceptors>
                <interceptor>
                   <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
                </interceptor>
             </interceptors>
          
             <assembly-descriptor>
                <interceptor-binding>
                   <ejb-name>*</ejb-name>
                   <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
                </interceptor-binding>
             </assembly-descriptor>
          

           

          And my applications.xml looks like this:

           

          <display-name>App-ear</display-name>
            <module>
              <ejb>jboss-seam.jar</ejb>
            </module>
            <module>
              <ejb>ejb1-ejb.jar</ejb>
            </module>
            <module>
              <web>
                <web-uri>App.war</web-uri>
                <context-root>App</context-root>
              </web>
            </module>