2 Replies Latest reply on Feb 23, 2008 8:23 AM by kukeltje

    problem with transaction

    mkalibek

      Hello, I'm quite new to jBPM.

      I wrote such part of code

      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
       try {
       TaskInstance ti = jbpmContext.loadTaskInstanceForUpdate(taskID);
       // do something
       ti.end();
       }
       finally {
       jbpmContext.close();
       }
      


      Here after task instance is finished, process instance must end.
      As I understand, jbpmContext saves task instance and then process instance attempts to be saved to. But following error occurs:

      16:08:22,015 ERROR [EjbSchedulerService] javax.naming.NameNotFoundException: ejb not bound
      16:08:22,015 ERROR [GraphElement] action threw exception: ejb local timer lookup problem
      org.jbpm.JbpmException: ejb local timer lookup problem
       at org.jbpm.scheduler.ejbtimer.EjbSchedulerService.<init>(EjbSchedulerService.java:34)
       at org.jbpm.scheduler.ejbtimer.EjbSchedulerServiceFactory.openService(EjbSchedulerServiceFactory.java:11)
       at org.jbpm.svc.Services.getService(Services.java:144)
       at org.jbpm.svc.Services.getCurrentService(Services.java:91)
       at org.jbpm.graph.exe.ProcessInstance.end(ProcessInstance.java:329)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
      ...
      ...
      ...
      


      In jbpm.cfg.xml settings are:
       <service name="persistence">
       <factory>
       <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
       <field name="isCurrentSessionEnabled">
       <true/>
       </field>
       </bean>
       </factory>
       </service>
      


      In hibernate.cfg.xml are:

       <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
       <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
       <property name="jta.UserTransaction">java:comp/UserTransaction</property>
      

      Anyone knows why it is?