2 Replies Latest reply on Nov 24, 2009 8:30 AM by Michael Remijan

    Set JNDI location for EJB 3.0 Bean in  jboss-4.2.1.GA

    Michael Remijan Newbie

      I'm using jboss-4.2.1.GA with EJB 3.0 session beans. I have 2 local, stateless session beans annotated with @Local. I can successfully deploy an EAR with the session beans as long as I do not have any configuration files.

      However, I want to use jboss.xml to specify where in JNDI the beans should be put/bound.

      When I add /META-INF/ejb-jar.xml and /META-INF/jboss.xml I get a NullPointerException when I try to deploy.

      My ejb-jar.xml is:
      --------------------

      <ejb-jar>
       <enterprise-beans>
       <session>
       <ejb-name>AlumniLocal</ejb-name>
       <local>org.ferris.oths.domain.alumni.AlumniLocal</local>
       <ejb-class>org.ferris.oths.domain.alumni.AlumniEjb</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       </session>
       <session>
       <ejb-name>AlumniPropertiesLocal</ejb-name>
       <local>org.ferris.oths.domain.properties.AlumniPropertiesLocal</local>
       <ejb-class>org.ferris.oths.domain.properties.AlumniPropertiesEjb</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       </session>
       </enterprise-beans>
      </ejb-jar>


      My jboss.xml is:
      ------------------
      <jboss>
       <enterprise-beans>
       <session>
       <ejb-name>AlumniLocal</ejb-name>
       <jndi-name>oths-domain/AlumniLocal</jndi-name>
       </session>
       <session>
       <ejb-name>AlumniPropertiesLocal</ejb-name>
       <jndi-name>oths-domain/AlumniPropertiesLocal</jndi-name>
       </session>
       </enterprise-beans>
      </jboss>


      Since the beans deploy fine without the configuration files (using only ejb3 annotations) there has to be somethign wrong with these configuration files. What am I doing wrong here?? How can I get this configuration correct??