0 Replies Latest reply on Feb 1, 2002 7:14 AM by Michael

    session bean can not found entity bean local interface

    Michael Newbie

      Hi all,

      I have an session bean that would talk to an entity bean through local interface. However, problem occurs when the session bean try to look up the entity bean local interface. The follow is my code snap-shot and I hope someone can kindly point out where the problem is.
      Many thanks.

      this is my deployment descriptor....


      <ejb-name>IdFactory</ejb-name>
      <local-home>com.x.IdFactoryLocalHome</local-home>
      com.x.IdFactory
      <ejb-class>com.x.IdFactoryEJB</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>IdFactoryEJB</abstract-schema-name>
      <cmp-field>
      <field-name>tableName</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>id</field-name>
      </cmp-field>
      <primkey-field>tableName</primkey-field>
      <resource-ref>
      <res-ref-name>aptutoringDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>



      <ejb-name>IdFactorySession</ejb-name>
      com.x.IdFactorySessionHome
      com.x.IdFactorySession
      <local-home>com.x.IdFactorySessionLocalHome</local-home>
      com.x.IdFactorySessionLocal
      <ejb-class>com.x.IdFactorySessionEJB</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <env-entry>

      <env-entry-name>retryCount</env-entry-name>
      <env-entry-type>java.lang.Integer</env-entry-type>
      <env-entry-value>5</env-entry-value>
      </env-entry>
      <env-entry>

      <env-entry-name>blockSize</env-entry-name>
      <env-entry-type>java.lang.Integer</env-entry-type>
      <env-entry-value>10</env-entry-value>
      </env-entry>

      </enterprise-beans>

      under session bean implement class, I have this ....

      public void setSessionContext(SessionContext sc) {
      try {
      Context namingContext = new InitialContext();
      blockSize = ((Integer)namingContext.lookup("java:comp/env/blockSize")).intValue();
      retryCount= ((Integer)namingContext.lookup("java:comp/env/retryCount")).intValue();
      idFactoryHome = (IdFactoryLocalHome)namingContext.lookup("IdFactoryLocalHome");
      system.out.println("Lookup");
      }
      catch(NamingException nExc) {
      System.out.println("Context naming problem, so fail. ...");
      throw new EJBException(nExc);
      }
      }