2 Replies Latest reply on Mar 6, 2004 6:20 AM by aslani

    Error when deploying BMP bean?

    aslani Newbie

      When I try to create my BMP bean with XDoclet like this:


      /

      **
       * FileBMPBean
       *
       * @author OpenBroad Group
       *
       * @ejb.bean
       * name="FileBMP"
       * type="BMP"
       * local-jndi-name="ejb/entity/BMP/FileBMP"
       * primkey-field="id"
       *
       *@ejb.finder
       * query="SELECT OBJECT(o) FROM file o"
       * signature = "java.util.Collection findAll()"
       *
       *
       * @ejb.persistence
       * table-name="file"
       *
       * @jboss.entity-command
       * name = "mysql-get-generated-keys"
       *
       * @jboss.persistence
       * datasource="java:/OpenBroadDB"
       * datasource-mapping="mySQL"
       */
      public class FileBMPBean implements EntityBean




      I get this exception:


      11:41:25,453 WARN [verifier] EJB spec violation:
      Bean : FileBMP
      Method : public abstract Collection findAll() throws FinderException, RemoteExce
      ption
      Section: 12.2.9
      Warning: Each finder method must match one of the ejbFind<METHOD> methods define
      d in the entity bean class.




      But I have a findAll() method in my bean?

      /**
       * @ejb.interface-method
       * view-type="local"
       */
       public java.util.Collection findAll()
       {
       Vector v = new Vector();
       Connection con = null;
       ResultSet rs = null;
       try
       {
       con = getConnection();
       Statement s = con.createStatement();
       rs = s.executeQuery("SELECT * FROM file");
       while (rs.next())
       {
       File f = new File(rs.getInt("id"),
       rs.getString("title"),
       rs.getInt("length"),
       rs.getDate("startDate"),
       rs.getDate("endDate"),
       rs.getString("description"),
       rs.getDate("created"),
       rs.getString("userName"),
       rs.getInt("typeId"));
      
       v.add(f);
       }
       }
       catch (SQLException e)
       {
       e.printStackTrace();
       }
       return v;
       }




      What am I doing wrong?