0 Replies Latest reply on Feb 26, 2002 12:07 PM by lasterra

    DAO and env-entry in ejb-jar.xml

    lasterra

      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 :-)

      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.