2 Replies Latest reply on Nov 15, 2010 2:26 AM by aneesh kumar CM

    Problem in timer

    aneesh kumar CM Newbie

      hi,

       

      iam using a timer in my appplication with jbpm4.3 with spring 2.5.

       

         <state name="waitForNotification">
              <transition name="go on" to="notificationStatusSuccess"/>
              <transition name="timeout" to="Timedout">
                  <timer duedate="30 seconds"/>
              </transition>
          </state>

       

      in my web.xml i have given setvlet

       

      <servlet>
               <servlet-name>JobExecutorServlet</servlet-name>
               <servlet-class>org.jbpm.job.executor.JobExecutorServlet</servlet-class>
               <load-on-startup>3</load-on-startup>
           </servlet>
          
           <servlet-mapping>
               <servlet-name>JobExecutorServlet</servlet-name>
               <url-pattern>/jobexecutor</url-pattern>
           </servlet-mapping>

       

      my jbpm.cfg.xml is here

       

      <jbpm-configuration>

       

        <jbpm-context>
          <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
          <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
          <service name="message" factory="org.mule.transport.bpm.jbpm.MuleMessageServiceFactory" />
          <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
          <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
          <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
        </jbpm-context>

       

        <string name="resource.jbpm.jobexecutor.cfg.xml" value="jbpm.jobexecutor.cfg.xml" />
        <string name="resource.jbpm.businesscalendar.cfg.xml" value="jbpm.businesscalendar.cfg.xml" />
        <string name="resource.jbpm.tx.hibernate.cfg.xml" value="jbpm.tx.hibernate.cfg.xml" />
        <string name="resource.jbpm.jpdl.cfg.xml" value="jbpm.jpdl.cfg.xml" />

       
        <!-- configuration property used by persistence service impl org.jbpm.persistence.db.DbPersistenceServiceFactory -->
        <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" />
       
         <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
        <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
        <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
        <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
        <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
        <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
        <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
        <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />

       

        <long name="jbpm.msg.wait.timout" value="5000" singleton="true" />
        <int name="jbpm.byte.block.size" value="1024" singleton="true" />
        <string name="mail.smtp.host" value="localhost" />
        <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
        <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
        <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
       
        <bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor" init-method="start">
          <field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field>
          <field name="name"><string value="JbpmJobExecutor" /></field>
          <field name="nbrOfThreads"><int value="1" /></field>
          <field name="idleInterval"><int value="5000" /></field>
          <field name="maxIdleInterval"><int value="3600000" /></field> <!-- 1 hour -->
          <field name="historyMaxSize"><int value="20" /></field>
          <field name="maxLockTime"><int value="600000" /></field> <!-- 10 minutes -->
          <field name="lockMonitorInterval"><int value="60000" /></field> <!-- 1 minute -->
          <field name="lockBufferTime"><int value="5000" /></field> <!-- 5 seconds -->
        </bean>
       
      </jbpm-configuration>

       

      The jbpm version is 4.3. The jbpm dependencies are

       

      <dependency>
              <groupId>javax.annotation</groupId>
              <artifactId>jsr250-api</artifactId>
              <version>1.0</version>
          </dependency>
          <dependency>
              <groupId>org.jbpm.jbpm4</groupId>
              <artifactId>jbpm-test-base</artifactId>
              <version>${jbpm.version}</version>
          </dependency>
          <dependency>
              <groupId>org.jbpm.jbpm4</groupId>
          <artifactId>jbpm-jpdl</artifactId>
              <version>${jbpm.version}</version>
          </dependency>
          <dependency>
              <groupId>org.jbpm.jbpm4</groupId>
              <artifactId>jbpm-pvm</artifactId>
              <version>${jbpm.version}</version>
          </dependency>

       

      While runnig the application using jetty server it is giving the error given below and also the timer is not fired.

       

      ERROR: org.jbpm.db.JobSession - org.hibernate.MappingException: Named query not known: JobSession.getFirstAcquirableJob
      ERROR: org.jbpm.job.executor.JobExecutorThread - exception in job executor thread. waiting 5000 milliseconds
      org.jbpm.JbpmException: couldn't get acquirable jobs
          at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:44)
          at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:114)
          at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:58)
      Caused by: org.hibernate.MappingException: Named query not known: JobSession.getFirstAcquirableJob
          at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:70)
          at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1260)
          at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:36)
          ... 2 more

       

      can anybody throw some light into this...

       

      regards

      Aneesh.

        • 1. Re: Problem in timer
          Michael Wohlfart Expert

          org.jbpm.persistence.db.DbPersistenceServiceFactory

          is a jBPM3 class and your jbpm.cfg.xml looks like a mix of jBPM3 and jBPM4 config options

          according to which documentation did you set up your config?

          1 of 1 people found this helpful
          • 2. Re: Problem in timer
            aneesh kumar CM Newbie

            hello Michael,

             

            Iam using Mule 2.2.1 in my project as well.

            Mule JBPM dependency is :

             

                 <dependency>
                        <groupId>org.mule.transports</groupId>
                        <artifactId>mule-transport-jbpm</artifactId>
                        <version>${muleVersion}</version>           
                    </dependency>

             

            I was not able to configure timer using mule-jbpm dependency. So iam confused about implementing Timer.

            So i tried with JBPM4.3 and so is the mismatch in jbpm.cfg.xml.

            Can u provide me with some documentation URL for reference to implement timer in JBPM3 or JBPM4.