1 Reply Latest reply on Aug 6, 2004 11:38 AM by Scott Stark

    Changing EJB JNDI Name

    David Salter Novice

      Hi,

      I'm trying to change the JNDI name of a stateless session bean to be the same as the class name so I can implement a EJBHomeFactory (ie do JNDI lookups just by specifying the class name of the remote home interface) but it doesn't seem to work.

      I'm editing the jboss.xml file for the bean, but the new JNDI name doesn't show up in the web-console or in JNDI.

      Has anyone done this sort of thing?

      My jboss.xml looks like

      <jboss>
      <session>
      <ejb-name>SearchTCEJB</ejb-name>
      <ejb-ref>
      <ejb-ref-name>ejb/SearchTCHome</ejb-ref-name>
      <jndi-name>ejb/com/company/session/stateful/SearchTCHome</jndi-name>
      </ejb-ref>
      <configuration-name>Standard Stateless SessionBean</configuration-name>
      </session>
      </jboss>



      My environment:
      JBoss 4 RC1, Windows XP


        • 1. Re: Changing EJB JNDI Name
          Scott Stark Master

          This is an invalid jboss.xml descriptor. Add the DTD refence and validate the document. All jboss deployment descriptor DTDs are available in the dist docs/dtd directory.

          <?xml version="1.0"?>
           <!DOCTYPE jboss PUBLIC
           "-//JBoss//DTD JBOSS 3.2//EN"
           "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
          <jboss>
          
           <enterprise-beans>
           <session>
           <ejb-name>ENCBean</ejb-name>
           <jndi-name>ENCBean-JNDI-Name</jndi-name>
           <ejb-ref>
           <ejb-ref-name>ejb/bean1</ejb-ref-name>
           <jndi-name>ENCTests/ejbs/ENCBean1</jndi-name>
           </ejb-ref>
           </session>
           </enterprise-beans>
          </jboss>