2 Replies Latest reply on Feb 9, 2009 1:39 AM by idan koch

    Timer and org.jbpm.web.JobExecutorLauncher in jbpm3.2GA

    tomerbd2 Newbie

      Hi,

      I'm trying to use a timer, so I have added the following code to my web xml

      <listener>
       <description>
       Starts the job executor on servlet context initialization and stops it on
       servlet context destruction.
       </description>
       <listener-class>org.jbpm.web.JobExecutorLauncher</listener-class>
       </listener>


      However when i run my workflow it says:


      Error instantiating web-application
      Error loading listener 'org.jbpm.web.JobExecutorLauncher', class not found


      I have noticed that this class file exists in 3.3.1GA and not in 3.2GA, however I do want to use 3.2GA because other releases don't support jdk1.4 (i tried for example 3.2.5GA and couldnt make it work with jdk1.4) so i'm using 3.2GA, can anyone tell me what should I put (if i should put anything) in my web.xml so that the timer will work in jbpm 3.2GA?

      Thanks

        • 2. Re: Timer and org.jbpm.web.JobExecutorLauncher in jbpm3.2GA
          idan koch Newbie

          Hi

          Thank you for your reply now i get:

          246836 [JbpmJobExector:172.30.9.27:1] ERROR org.jbpm.job.executor.JobExecutorThread - exception in job executor thread. waiting 160000 milliseconds
          org.jbpm.util.JndiLookupException: couldn't fetch 'java:/hibernate/SessionFactory' from jndi
          at org.jbpm.util.JndiUtil.lookup(JndiUtil.java:41)
          at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:87)
          at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94)
          at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98)
          at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:352)
          at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563)
          at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109)
          at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56)
          Caused by: javax.naming.NamingException: Not in an application scope - start Orion with the -userThreads switch if using user-created threads
          at com.evermind.server.PreemptiveApplicationContext.getContext(PreemptiveApplicationContext.java:34)
          at com.evermind.naming.FilterContext.lookup(FilterContext.java:138)
          at javax.naming.InitialContext.lookup(InitialContext.java:347)
          at org.jbpm.util.JndiUtil.lookup(JndiUtil.java:36)
          ... 7 more

          I'm using OC4J server with jbpm version 3.2 and oracle 10g DB where do i need to define the session factory?

          i have in hibernate.cfg.xml:

          
           <session-factory name="java:/hibernate/SessionFactory">
          
           <!-- hibernate dialect -->
           <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
          
           <!-- JDBC connection properties (begin) -->
           <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
           <property name="hibernate.connection.url">jdbc:oracle:thin:@//****:1521/***</property>
           <property name="hibernate.connection.username">****</property>
           <property name="hibernate.connection.password">****</property>
           <!-- JDBC connection properties (end) -->
          
           <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
          
           <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
           <property name="hibernate.session_factory_name">java:/hibernate/SessionFactory</property>
          
           <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
           <!--<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.OrionTransactionManagerLookup</property>-->
           <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.OC4JTransactionManagerLookup</property>
           <property name="jta.UserTransaction">java:comp/UserTransaction</property>
          


          and in the jbpm.cfg.xml:
           <jbpm-context>
           <service name="persistence">
           <factory>
           <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
           <field name="isTransactionEnabled"><false/></field>
           <field name="isCurrentSessionEnabled"><true/></field>
           <field name="sessionFactoryJndiName">
           <string value="java:/hibernate/SessionFactory" />
           </field>
           </bean>
           </factory>
           </service>
           <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
           </jbpm-context>
          
          

          what else do i need define?