3 Replies Latest reply on Sep 21, 2007 3:47 AM by jayaranga

    Scheduler with seam 1.2.1 throws an IllegalArgumentException

    jayaranga

      Hi All,
      Im using seam 1.2.1 on jboss-4.0.5.GA

      Im trying to create a scheduler using @Asynchronous, which is to be started on application startup

      here is my code :
      interface

      public interface DRAMP_PDMTimeOut {
       @Asynchronous
       public Timer scheduleMail(@Duration long when,
       @IntervalDuration long interval,@Expiration Date date);
       @Destroy
       @Remove
       public void destroy();
      }


      implementation :



      public class DRAMP_PDMTimeOutAction extends BusinessLogicAdapter implements DRAMP_PDMTimeOut{
       @In Timer timer;
      
      
       public Timer scheduleMail(@Duration long when,
       @IntervalDuration long interval, @Expiration Date date){
       PreDepartureMailTextLogger.logMessage("currentPortal ");
      // do something
       }
      }
      

      my caller method :
      @Stateful
      @Scope(APPLICATION)
      @Name("roomsnet.r5.admin.businesslogic.PredepartureTimerLogicAction")
      @Startup()
      public class DRAMP_PredepartureTimerLogicAction extends BusinessLogicAdapter implements DRAMP_PredepartureTimerLogic {
      
       @In(create=true)
       private DRAMP_PDMTimeOut action;
      
       @In
       private Timer timer;
      
       public DRAMP_PredepartureTimerLogicAction() {
       PreDepartureMailTextLogger.logMessage("@ constructor............... ");
       }
      
      
      
       @PostConstruct
       public void createTimer() {
       PreDepartureMailTextLogger.logMessage("@createTimer........ ");
      
       try {
      
       PreDepartureMailTextLogger.logMessage("this should fire ");
      
       timer = action.scheduleMail(60*1000 * 2, 60*1000 * 2, new Date());
      
      
       } catch (Exception e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       }
      }
      
      



      Problem is, it throws an exception when the schedule task invoked.
      2007-09-21 10:50:46,393 ERROR [org.jboss.ejb.txtimer.TimerImpl] Error invoking ejbTimeout: javax.ejb.EJBException: java.lang.IllegalArgumentException: Could not invoke method by reflection: Object_$$_javassist_2145.scheduleMail(long, long, java.util.Date) with parameters: (org.jboss.seam.Component) on: org.javassist.tmp.java.lang.Object_$$_javassist_2145
      


      Anybody please help me