2 Replies Latest reply on Mar 1, 2004 10:28 AM by Jerrold Eads

    finders in JBoss3.2.3

    Jerrold Eads Newbie

      I am trying to configure a findAll() and a findByAppForeignKeys(String, Integer) in some of my entity beans. I configure my ejb-jar as follows:
      < entity>
      < display-name>MSSQLServer2000MetaData_ActivityLog</display-name>
      < ejb-name>MSSQLServer2000MetaData_ActivityLog</ejb-name>
      < local-home>com.genecodes.mssqlserver2000metadata.activitylog.ActivityLogHome</local-home>
      < local>com.genecodes.mssqlserver2000metadata.activitylog.ActivityLog
      < ejb-class>com.genecodes.mssqlserver2000metadata.activitylog.ActivityLogBean</ejb-class>
      < persistence-type>Container</persistence-type>
      < prim-key-class>com.genecodes.mssqlserver2000metadata.activitylog.ActivityLogPK</prim-key-class>
      < reentrant>False
      < cmp-version>2.x</cmp-version>
      < abstract-schema-name>MSSQLServer2000MetaData_ActivityLog</abstract-schema-name>
      < cmp-field>
      <field-name>id</field-name>
      </cmp-field>
      < cmp-field>
      <field-name>recNum</field-name>
      </cmp-field>
      < cmp-field>
      <field-name>eventDate</field-name>
      </cmp-field>
      < cmp-field>
      <field-name>application</field-name>
      </cmp-field>
      < cmp-field>
      <field-name>dataStore</field-name>
      </cmp-field>
      < cmp-field>
      <field-name>description</field-name>
      </cmp-field>
      < cmp-field>
      <field-name>tableName</field-name>
      </cmp-field>
      < cmp-field>
      <field-name>tableId</field-name>
      </cmp-field>
      < cmp-field>
      <field-name>additionalInfo</field-name>
      </cmp-field>
      < query>
      < query-method>
      < method-name>findAll</method-name>
      < method-params/>
      </query-method>
      < return-type-mapping>Local</return-type-mapping>
      < ejb-ql><![CDATA[SELECT OBJECT(o)FROM MSSQLServer2000MetaData_ActivityLog o]]></ejb-ql>

      < query>
      < query-method>
      < method-name>findByAppForeignKeys</method-name>
      < method-params>
      < method-param>String</method-param>
      < method-param>Integer</method-param>
      </method-params>
      </query-method>
      < return-type-mapping>Local</return-type-mapping>
      < ejb-ql><![CDATA[SELECT OBJECT(s)FROM MSSQLServer2000MetaData_ActivityLog s WHERE s.tableName = ?1 AND s.tableId = ?2]]></ejb-ql>

      < security-identity>
      < description/>
      < use-caller-identity/>
      </security-identity>


      The home interface looks like:
      package com.genecodes.mssqlserver2000metadata.activitylog;

      import javax.ejb.*;
      import java.util.*;
      import com.genecodes.mssqlserver2000metadata.activityeventcode.*;
      import com.genecodes.mssqlserver2000metadata.users.*;

      /**
      * Home Interface for ActivityLog bean
      *
      * Title: Kahuna
      * Description: Data driven sequencing architecture
      * @author $, SynApps Software
      * @version $Revision: 1.3 $, $Date: 2004/02/26 23:29:13 $
      */
      public interface ActivityLogHome extends javax.ejb.EJBLocalHome
      {
      public ActivityLog create(
      Integer recNum,
      java.util.Date eventDate,
      String application,
      String dataStore,
      String description,
      String tableName,
      Integer tableId,
      java.lang.Character additionalInfo,
      ActivityEventCode event,
      Users user ) throws CreateException;

      public ActivityLog findByPrimaryKey(ActivityLogPK pk) throws FinderException;
      public Collection findAll() throws FinderException;
      public Collection findByAppForeignKeys(String tableName, Integer tableId) throws FinderException;
      }

      When I deploy the bean I get the following error:
      2004-02-27 13:24:26,921 WARN [org.jboss.ejb.EJBDeployer.verifier] EJB spec violation:
      Bean : MSSQLServer2000MetaData_ActivityLog
      Method : public abstract Collection findByAppForeignKeys(String, Integer) throws FinderException
      Section: 10.5.6
      Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.

      2004-02-27 13:24:27,453 n [org.jboss.deployment.MainDeployer] could not create deployment: file:/C:/jboss-3.2.3_tomcat-4.1.29/server/default/deploy/mssqlserver2000metadata.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.

      Is my deployment descriptor correct for this version of JBoss? Any help will be greatly appreciated.

      Thanks
      Jerry