1 Reply Latest reply on Mar 21, 2002 1:05 PM by Shailesh Dangi

    Third Respost..In a desparate need for  answers...JBoss Guru

    Shailesh Dangi Newbie

      Third Repost....

      -- JBoss 3.0 + Tomcat 4.0 on NT --

      I ran into a problem for an entity bean with BMP.
      The findByPrimaryKey works fine. But with custom finder methods the bean implementation is not even called.

      Here are sample snippets of the code:

      public interface FwkTabHome extends EJBHome {
      public FwkTab create(Integer pkId, Integer orgId) throws RemoteException, CreateException;
      //This works fine
      public FwkTab findByPrimaryKey(FwkTabPK primaryKey) throws FinderException, RemoteException;
      //This doesn't
      public Collection findByAllAncestors(FwkTabPK primaryKey) throws FinderException, RemoteException;

      Section of FwkBean
      public Collection ejbFindByAllAncestors(FwkTabPK primaryKey) throws FinderException, RemoteException{
      PreparedStatement ps = null;
      ResultSet rs = null;
      Connection conn = null;
      Vector v = new Vector();
      conn = this.getConnection();
      //This statement is not even printed in the log
      System.out.println("Connection in ejbFindAllAncestors :" + conn.getMetaData().getDriverName());
      if (conn != null)
      ps = conn.prepareStatement(" select ftb_tab_id from fwk_tabs "+
      " start with ftb_tab_id = ? "+
      " and org_id = ? " +
      " connect by prior ftb_parent_id = ftb_tab_id " +
      " and org_id = ? " +
      " order by ftb_level asc");
      if (ps != null){
      rs = ps.executeQuery();
      if (rs == null)
      throw new EJBException("Error extracting resultset in ejbFindAllAncestors");

      FwkTabPK pk = new FwkTabPK((Integer)rs.getObject("ftb_tab_id"), primaryKey.getOrgId());
      System.out.println("Object added: " + pk.toString());
      }catch(java.sql.SQLException sqlEx){
      throw new EJBException("Error in finder method", sqlEx);
      if (rs != null)
      if (ps != null)
      if (conn != null)
      }catch(Exception e){
      return v;
      Do I have to add this custom finder method in some property file for JBoss to pick up?
      Moreover, while deploying, the deployment tool (autodeployer??) DOESNOT complain if find method in home interface throws different exceptions from the ejbFind method in the entity bean class. Shouldn't that be checked at the time of deployment also?

      Thanks ...Please help...Have a EJB container vendor selection meeting next week. And as all wise people would do, I am pushing for JBoss...So please help to finish up my use cases.