2 Replies Latest reply on Apr 23, 2004 1:26 PM by massiccio

    EJB spec violation 12.2.11

    massiccio Newbie

      Hi all,
      when I try to deploy my beans, I get the following message:

      WARN [verifier] EJB spec violation:
      Bean : Studente
      Method : public abstract StudenteLocal checkPassword(Long, String) throws FinderException
      Section: 12.2.11
      Warning: Each local home method must match a method defined in the entity bean class.

      13:06:12,818 WARN [verifier] EJB spec violation:
      Bean : Admin
      Method : public abstract AdminLocal checkPassword(Integer, String) throws FinderException
      Section: 12.2.11
      Warning: Each local home method must match a method defined in the entity bean class.

      13:06:13,036 WARN [verifier] EJB spec violation:
      Bean : Docente
      Method : public abstract DocenteLocal checkPassword(Long, String) throws FinderException
      Section: 12.2.11
      Warning: Each local home method must match a method defined in the entity bean class.


      ERROR [MainDeployer] could not create deployment: file:/Applications/jboss-3.2.2/server/default/deploy/MyExams.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)


      The query is the following (in the EntityBean):

      @ejb.finder
      * signature = "bean.cmp.AdminLocal checkPassword(java.lang.Integer userId, java.lang.String passwd)"
      * query = "SELECT OBJECT(a) FROM Admin a where a.id_admin = ?1 and a.password = ?2"


      and this is the code of the SessionBean:

      public class CambioPasswdBean implements SessionBean {

      private SessionContext ctx;
      private StudenteLocalHome studentHome= null;
      private DocenteLocalHome docenteHome = null;
      private AdminLocalHome adminHome = null;

      ......


      /**
      * @ejb.interface-method
      * view-type="remote"
      * @return void
      * @throws InvalidParameterException
      * @throws javax.ejb.FinderException
      * @throws EJBException
      * @param Object id utente
      * @param String old password
      * @param String new password
      */
      public void changePassword(Object id, String oldPasswd, String newPasswd, int ruolo){
      switch (ruolo)
      {
      case 0: //amministratore
      {
      Debug.print(this.getClass().getName() + " changePassword");
      try{
      AdminLocal al = null;
      if((al = adminHome.checkPassword((Integer)id, oldPasswd)) != null){
      al.setPassword(newPasswd);
      }
      else{
      Debug.err("Password non valida!");
      throw new InvalidParameterException("Password non valida");
      }
      }catch(Exception e){
      Debug.err(e.getMessage());
      }
      }
      break;

      case 1: //docente
      {
      Debug.print(this.getClass().getName() + " changePassword");
      try{
      DocenteLocal dl = null;
      if((dl = docenteHome.checkPassword((Long)id, oldPasswd)) != null){
      dl.setPassword(newPasswd);
      }
      else{
      Debug.err("Password non valida!");
      throw new InvalidParameterException("Password non valida");
      }
      }catch(Exception e){
      Debug.err(e.getMessage());
      }
      }
      break;

      case 2: //studente
      {
      Debug.print(this.getClass().getName() + " changePassword");
      try{
      StudenteLocal sl = null;
      if((sl = studentHome.checkPassword((Long)id,oldPasswd)) != null){
      sl.setPassword(newPasswd);
      }
      else{
      Debug.err("Password non valida!");
      throw new InvalidParameterException("Password non valida");
      }

      }catch(Exception e){
      Debug.err(e.getMessage());
      }
      }
      break;
      }
      }/*changePassword*/