2 Replies Latest reply on Aug 5, 2007 3:21 PM by rjstanford

    Splitting EJB components into multiple jar files

      I'm splitting an existing Seam project into multiple EJB jars - one for the data model, one for the services, et cetera.

      During startup, I get this INFO log:

      13:50:20,144 INFO [Component] Component: register, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: com.kimbia.actions.RegisterAction, JNDI: Company.ear/RegisterAction/local


      In the components.xml file that's located in my war file's /WEB-INF/ directory, I have this line:

      <core:init jndi-pattern="Company.ear/#{ejbName}/local" debug="false" />


      But when I try to refer to the component, I get the following exception:

      org.jboss.seam.InstantiationException: Could not instantiate Seam component: register
      ...
      Caused by: javax.naming.NameNotFoundException: Company.ear not bound


      Changing the jndi-pattern changes the error message, so that seems to be working fine. But from the log, it looks as if "Company.ear/.../local" is exactly the right pattern to be using.

      Any advice would be very welcomed at this point.

        • 1. Re: Splitting EJB components into multiple jar files

          One more piece of information - earlier in the log, this was output:

          13:50:17,113 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=Company.ear,jar=Stateful.jar,name=RegisterAction,service=EJB3 with dependencies:
          13:50:17,114 INFO [JmxKernelAbstraction] persistence.units:ear=Company.ear,unitName=dbcluster
          13:50:17,253 INFO [EJBContainer] STARTED EJB: com.kimbia.actions.RegisterAction ejbName: RegisterAction


          • 2. Re: Splitting EJB components into multiple jar files

            More possibly useful (or misleading) information.. changing the web.xml file to read

            <core:init jndi-pattern="#{ejbName}/local" debug="false" />
            makes two changes - first, Seam states:

            14:16:17,124 INFO [Component] Component: register, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: com.kimbia.actions.RegisterAction, JNDI: RegisterAction/local


            Second, the exception changes:

            org.jboss.seam.InstantiationException: Could not instantiate Seam component: register
            ...
            Caused by: javax.naming.NameNotFoundException: RegisterAction not bound


            It seems really odd that this setting is being applied both to the Seam reporting and the Instantiation exception, since to me that implies that Seam was indeed able to find it once (during startup)... and yet now its not being found.

            I'm sure that I'm missing something basic, I'm just not sure what.