0 Replies Latest reply on Feb 28, 2002 4:05 PM by Enrique Rodriguez

    DAO and env-entry in ejb-jar.xml

    Enrique Rodriguez Newbie

      (I posted this problem on another forum and i get no response)
      Hi all, i'm trying to implement the fast-lane reader desing pattern.

      This pattern use Data Access Object to get register of the database fater than through an EJB. I don't know how faster, so i like to implement this pattern to know it <http://main.jboss.org/images/emoticons/happy.gif>

      Ok, the problem i have is that DAO Implementation class is binded in the JNDI by the ejb-jar.xml, more exactly, in the env-entry tag.

      I'm using jboss2.4.4 and i'cant lookup this env-entry.
      This is my ejb-jar:
      <?xml version="1.0" encoding="UTF-8" ?>

      <ejb-jar>
      <enterprise-beans>

      Ejemplo EJB
      <ejb-name>Grupo</ejb-name>
      <local-home>ejb.GrupoLocalHome</local-home>
      ejb.GrupoLocal
      <ejb-class>ejb.GrupoEJB</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <env-entry>
      <env-entry-name>GrupoDAO</env-entry-name>
      <env-entry-value>dao.GrupoDAOImpl</env-entry-value>
      <env-entry-type>java.lang.String</env-entry-type>
      </env-entry>

      </enterprise-beans>
      </ejb-jar>

      I try to lookup this inveroment entry in this way:

      InitialContext ic = new InitialContext();
      String className = (String) ic.lookup(java:comp/env/GrupoDAO);

      What am i doing wrong???

      Thanks and pardon for my poor english, Enrique.