4 Replies Latest reply on Jun 28, 2006 4:37 AM by Gregory Mostizky

    Role of JbpmThreadsServlet & CommandExecutorThread

    Prashanth Sukumaran Newbie

      Hi,

      I think i was able to plugin jbpm into my spring app. Curious about the role of JbpmThreadsServlet & CommandExecutorThread.

      Coz., since my session and transaction is defined in spring and also jbpmContext is defined in spring, should i modify JbpmThreadsServlet and pass the jbpmConfiguration to CommandExecutorThread from appContext.

      Also since the hbm.xml are define in Spring while defining the sessionFactory what do i do about resource.hibernate.cfg.xml defined in jbpm.cfg.xml. When i removed it from jbpm.cfg.xml i see a org.hibernate.HibernateException: /hibernate.cfg.xml not found.

      Very Confused. Help Please!!!!

      Thanks
      Prash

        • 1. Re: Role of JbpmThreadsServlet & CommandExecutorThread
          Prashanth Sukumaran Newbie

          Should i modify the JbpmThreadsServlet to pass the JPBMConfiguration from the Spring appContext.

          Thanks
          Prashanth

          • 2. Re: Role of JbpmThreadsServlet & CommandExecutorThread
            Prashanth Sukumaran Newbie

            Since i did not get any reply i decided to plugin the jbpmConfiguration using

            Changes to org.jbpm.web.JBPMThreadsServlet.java
            
            ApplicationContext ctx =
             WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
            
            JbpmConfiguration jbpmConfiguration = (JbpmConfiguration)ctx.getBean("jbpmConfiguration");
            
            commandExecutorThread = new CommandExecutorThread(jbpmConfiguration);
            commandExecutorThread.start();
            
            schedulerThread = new SchedulerThread(jbpmConfiguration);
            schedulerThread.start();
            


            Now i am getting this exception.

            2006-05-24 12:46:27,758 ERROR org.jbpm.msg.command.CommandExecutorThread - org.jbpm.configuration.ConfigurationException: no messaging service available
            org.jbpm.persistence.JbpmPersistenceException: couldn't rollback hibernate session
            at com.donorschoose.workflow.SpringDbPersistenceService.close(SpringDbPersistenceService.java:154)
            at org.jbpm.svc.Services.close(Services.java:211)
            at org.jbpm.JbpmContext.close(JbpmContext.java:138)
            at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:138)

            at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
            Caused by: org.hibernate.TransactionException: Transaction not successfully started
            at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
            at com.donorschoose.workflow.SpringDbPersistenceService.close(SpringDbPersistenceService.java:152)
            ... 4 more
            2006-05-24 12:46:32,765 ERROR org.jbpm.svc.Services - problem closing service 'persistence'
            org.jbpm.persistence.JbpmPersistenceException: couldn't rollback hibernate session
            at com.donorschoose.workflow.SpringDbPersistenceService.close(SpringDbPersistenceService.java:154)
            at org.jbpm.svc.Services.close(Services.java:211)
            at org.jbpm.JbpmContext.close(JbpmContext.java:138)
            at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:138)

            at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
            Caused by: org.hibernate.TransactionException: Transaction not successfully started
            at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
            at com.donorschoose.workflow.SpringDbPersistenceService.close(SpringDbPersistenceService.java:152)
            ... 4 more


            I am using the code provided by criess in the follwing post
            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=78052.

            Anybody, please help why is this happenning. Some hints.

            Thanks
            Prash

            • 4. Re: Role of JbpmThreadsServlet & CommandExecutorThread
              Gregory Mostizky Newbie

              I am dealing with the same issue right now.
              The problem seems that CommandExecutorThread is not opening/closing transactions. I am going to try to fix that by wrapping executeCommand() method of CommandExecutorThread to manually open/commit.