0 Replies Latest reply on Mar 17, 2004 2:30 AM by erongd

    JNDI_NAME vs COMP_NAME

    erongd

      Hi, Everyone:

      I have this situation that I want to use a Entity Bean with in a Session Stateless Bean. I want to lookup the Local Home Interface of the Entity Bean within the Stateless Bean. But I can only lookup the Entity Bean using the JNDI_NAME not the COMP_NAME. Does anyone know why?

      COMP_NAME="java:comp/env/ejb/CustomerLocal"
      JNDI_NAME="CustomerLocal"

      I'm using JBoss2.4.10 with j2sdk1.4.1_07 on Windows XP.

      Here is my jboss.xml file:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss_2_4.dtd">



      <unauthenticated-principal>nobody</unauthenticated-principal>

      <enterprise-beans>


      <ejb-name>Customer</ejb-name>
      <jndi-name>CustomerBean</jndi-name>
      <local-jndi-name>CustomerLocal</local-jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/DefaultDS</res-ref-name>
      <jndi-name>java:/DefaultDS</jndi-name>
      </resource-ref>




      <ejb-name>StoreAccessState</ejb-name>
      <jndi-name>StoreAccessStateBean</jndi-name>
      <local-jndi-name>StoreAccessStateLocal</local-jndi-name>
      <configuration-name>Standard Stateful SessionBean</configuration-name>
      <resource-ref>
      <res-ref-name>jdbc/DefaultDS</res-ref-name>
      <jndi-name>java:/DefaultDS</jndi-name>
      </resource-ref>




      <ejb-name>StoreAccess</ejb-name>
      <jndi-name>StoreAccessBean</jndi-name>
      <local-jndi-name>StoreAccessLocal</local-jndi-name>
      <ejb-local-ref>
      <ejb-ref-name>ejb/CustomerLocal</ejb-ref-name>
      <jndi-name>CustomerLocal</jndi-name>
      </ejb-local-ref>

      <resource-ref>
      <res-ref-name>jdbc/DefaultDS</res-ref-name>
      <jndi-name>java:/DefaultDS</jndi-name>
      </resource-ref>


      </enterprise-beans>

      <resource-managers>
      </resource-managers>




      Thanks
      Eric