1 Reply Latest reply on Jan 9, 2007 6:32 PM by kukeltje

    Timer not created in database, yet the hibernate log shows i

    jtyrrell

      I am running through the example getting started with jBPM examples on the JBoss wiki. I modified the example app to have the following:

      <state name="auction">
       <timer name="testTimer"
       duedate='1 business minutes'
       repeat='.5 business minutes'
       transition='time-out-transition' >
       <action class="com.jboss.test.Reminder"/>
       </timer>
       </state>



      However, when I am running this as the default created project in Eclipse I get the followiing error:
      17:47:12,865 [main] DEBUG SchedulerThread : checking for timers
      17:47:12,884 [main] WARN JDBCExceptionReporter : SQL Error: -22, SQLState: S0002
      17:47:12,884 [main] ERROR JDBCExceptionReporter : Table not found in statement [select top ? timer0_.ID_ as col_0_0_ from JBPM_TIMER timer0_ where (timer0_.EXCEPTION_ is null) and timer0_.ISSUSPENDED_<>1 order by timer0_.DUEDATE_ asc]
      17:47:12,885 [main] ERROR SchedulerSession : org.hibernate.exception.SQLGrammarException: could not execute query using iterate
      17:47:12,885 [main] DEBUG JbpmContext : closing JbpmContext
      17:47:12,886 [main] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@19855ed
      17:47:12,886 [main] DEBUG DbPersistenceService : committing hibernate transaction
      17:47:12,887 [main] DEBUG DbPersistenceService : closing hibernate session
      17:47:12,888 [main] INFO SchedulerThread : runtime exception while executing timers
      org.jbpm.JbpmException: couldn't find timers from the database
      at org.jbpm.db.SchedulerSession.findTimersByDueDate(SchedulerSession.java:99)


      Looking at the source the code is trying to get the Timer table...but in looking further up my stack of code I see this:
      17:47:08,746 [main] INFO Configuration : Reading mappings from resource: org/jbpm/scheduler/exe/Timer.hbm.xml
      17:47:08,761 [main] INFO HbmBinder : Mapping class: org.jbpm.scheduler.exe.Timer -> JBPM_TIMER

      I have read through the forms and copied the contents of the jbpm.cfg.xml file into my eclipse created jBPM project and also the hibernate.cfg.xml file.

      If anyone can shed some light on what other knobs I need to twist to make this work in a standalone environment.

      Please note I have the following code running, and this is where the code that can not find the Timer table is executed within:
       SchedulerThread scheduler = new SchedulerThread();
       scheduler.setInterval(2000);
       scheduler.run();
      

      and this is from where the error is created.