1 Reply Latest reply on Mar 17, 2004 8:05 AM by luisfpg

    Problem acessing a SessionBean local interface from the web

    luisfpg

      I have an application where I cannot access the java:comp/env namespace (I get a comp not bound exception).
      Can someone help?
      The files are on an EAR containing the web module and the ejb module.
      I have the following deployment descriptors:

      web.xml
      ----------
      ... (All the rest) ...
       <ejb-local-ref>
       <ejb-ref-name>ejb/Server</ejb-ref-name>
       <ejb-ref-type>session</ejb-ref-type>
       <local-home>dbserver.dbguardian.server.ejb.ServerLocalHome</local-home>
       <local>dbserver.dbguardian.server.ejb.ServerLocal</local>
       <ejb-link>Server</ejb-link>
       </ejb-local-ref>
      </web-app>
      
      
      jboss-web.xml
      -----------------
      <jboss-web>
       <class-loading java2ClassLoadingCompliance="false"/>
      </jboss-web>
      
      
      ejb-jar.xml
      -------------
      ... (All the rest) ...
       <session >
       <ejb-name>DataFacade</ejb-name>
       <home>dbserver.dbguardian.server.ejb.DataFacadeHome</home>
       <remote>dbserver.dbguardian.server.ejb.DataFacadeRemote</remote>
       <local-home>dbserver.dbguardian.server.ejb.DataFacadeLocalHome</local-home>
       <local>dbserver.dbguardian.server.ejb.DataFacadeLocal</local>
       <ejb-class>dbserver.dbguardian.server.ejb.DataFacadeSession</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       </session>
       <session >
       <ejb-name>Server</ejb-name>
       <home>dbserver.dbguardian.server.ejb.ServerHome</home>
       <remote>dbserver.dbguardian.server.ejb.ServerRemote</remote>
       <local-home>dbserver.dbguardian.server.ejb.ServerLocalHome</local-home>
       <local>dbserver.dbguardian.server.ejb.ServerLocal</local>
       <ejb-class>dbserver.dbguardian.server.ejb.ServerSession</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       <ejb-local-ref >
       <ejb-ref-name>ejb/DataFacade</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <local-home>dbserver.dbguardian.server.ejb.DataFacadeLocalHome</local-home>
       <local>dbserver.dbguardian.server.ejb.DataFacadeLocal</local>
       <ejb-link>DataFacade</ejb-link>
       </ejb-local-ref>
       </session>
      ... (All the rest) ...
      
      
      jboss.xml
      -----------
      <jboss>
       <enterprise-beans>
       <session>
       <ejb-name>DataFacade</ejb-name>
       <jndi-name>ejb/dbguardian/DataFacade</jndi-name>
       <local-jndi-name>ejb/dbguardian/DataFacadeLocal</local-jndi-name>
       <method-attributes>
       </method-attributes>
       </session>
       <session>
       <ejb-name>Server</ejb-name>
       <jndi-name>ejb/dbguardian/Server</jndi-name>
       <local-jndi-name>ejb/dbguardian/ServerLocal</local-jndi-name>
       <method-attributes>
       </method-attributes>
       </session>
       </enterprise-beans>
       <resource-managers>
       </resource-managers>
      </jboss>
      
      


        • 1. Re: Problem acessing a SessionBean local interface from the
          luisfpg

          I've just figured out that the <ejb-link> values were wrong.
          I changed them to the ejb.jar#NAME and the deploy seems ok.

          But now, I have another problem:
          It seems like the InitialContext is trying to lookup a remote server (?!?), because I'm getting an CommunicationException: Receive timed out.
          I try the following code (within a JSP):

          javax.naming.InitialContext ic = new javax.naming.InitialContext();
          javax.naming.NamingEnumeration enum = ic.list("ejb");
          

          What can be wrong?