2 Replies Latest reply on Jul 20, 2004 10:44 AM by madadi

    Problem with finder method in CMP (Auto-increment filed in t

    madadi Newbie

      Dear all,

      I need help , i have a problem with finder method when i want to send 2 parameters i am getting deployment error.

      My databse contains a table called group_assignment i created using Auto-increment field.like this..

      CREATE TABLE group_assignment(id MEDIUMINT NOT NULL AUTO_INCREMENT,userid VARCHAR(30),group_id VARCHAR(30),PRIMARY KEY(id))TYPE=INNODB;

      Note: one user can be in different Groups .and i am able to add user in different groups but when i am trying delete i am getting problems.

      in my Groupassignment Home i wrote like this...

      public Collection findByGrouptoDeleteUser(String userid,String group_id) throws FinderException, RemoteException;

      I want to delete user from any Group ,so i wrote in session session bean……….


      Groupassignment usr = (Groupassignment) homeg.findByGrouptoDeleteUser(user,usergroup);

      usr.remove();


      In Deployment descriptor i wrote like this...



      <query-method>
      <method-name>findByGrouptoDeleteUser</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <return-type-mapping>Local</return-type-mapping>
      <ejb-ql>SELECT OBJECT(r) FROM Groupassignment AS r WHERE r.userid = ?1 AND r.group_id = ?2</ejb-ql>


      I am getting following error....when i deployed my .ear file.

      14:38:58,832 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.1/server/default/deploy/database.ear
      14:38:58,842 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-3.2.1/server/default/deploy/database.ear
      14:38:59,974 WARN [verifier] EJB spec violation:
      Bean : GroupassignmentEjb
      Method : public abstract Collection findByGrouptoDeleteUser(String, String) throws FinderException, RemoteException
      Section: 10.5.6
      Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.

      14:39:00,064 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.2.1/server/default/tmp/deploy/server/default/deploy/database.ear/36.database.ear-contents/Register.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:776)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:190)
      1

      Hope you people can respond as soon as....

      regards
      madadi