5 Replies Latest reply on Jun 2, 2009 2:32 AM by Xiaohong Zheng

    Transaction Exception with JBPM and Seam on WebLogic 9.2

    Neil C Novice

      I am deploying a JBPM process definition to WebLogic 9.2.  After I get to the first page of the process, I submit and find myself redirected to that first page.  When I check the logs, I find this exception:


      17 Jun 2008 18:09:04,352: DEBUG org.jbpm.graph.def.GraphElement - event 'before-signal' on 'StartState(start)' for 'Token(/)'
      17 Jun 2008 18:09:04,352: DEBUG org.jbpm.graph.def.GraphElement - event 'node-leave' on 'StartState(start)' for 'Token(/)'
      17 Jun 2008 18:09:04,352: DEBUG org.jbpm.graph.def.GraphElement - event 'transition' on 'Transition(14d87c1)' for 'Token(/)'
      17 Jun 2008 18:09:04,352: DEBUG org.jbpm.graph.def.GraphElement - event 'node-enter' on 'TaskNode(beginOrder)' for 'Token(/)'
      17 Jun 2008 18:09:04,352: WARN  org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog - Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
      17 Jun 2008 18:09:04,352: DEBUG org.jbpm.graph.def.GraphElement - event 'task-create' on 'Task(beginOrder)' for 'Token(/)'
      17 Jun 2008 18:09:04,352: DEBUG org.jbpm.graph.def.GraphElement - event 'task-assign' on 'Task(beginOrder)' for 'Token(/)'
      17 Jun 2008 18:09:04,352: DEBUG org.jbpm.graph.def.GraphElement - event 'after-signal' on 'StartState(start)' for 'Token(/)'
      17 Jun 2008 18:09:04,432: DEBUG org.jboss.seam.bpm.ManagedJbpmContext - flushing seam managed jBPM context
      17 Jun 2008 18:09:04,432: ERROR org.hibernate.transaction.JDBCTransaction - exception calling user Synchronization
      java.lang.IllegalStateException: Transaction already active
              at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:35)
              at org.jboss.seam.transaction.EntityTransaction.begin(EntityTransaction.java:81)
              at org.jboss.seam.util.Work.workInTransaction(Work.java:35)
              at org.jboss.seam.bpm.TaskInstance.getTaskInstance(TaskInstance.java:39)
              at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
              at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2074)
              at org.jboss.seam.Component.unwrap(Component.java:2100)
              at org.jboss.seam.Component.getInstance(Component.java:1879)
              at org.jboss.seam.Component.getInstance(Component.java:1844)
              at org.jboss.seam.Component.getInstance(Component.java:1821)
              at org.jboss.seam.Component.getInstance(Component.java:1816)
              at org.jboss.seam.bpm.TaskInstance.instance(TaskInstance.java:64)
              at org.jboss.seam.contexts.BusinessProcessContext.getTaskInstance(BusinessProcessContext.java:231)
              at org.jboss.seam.contexts.BusinessProcessContext.flush(BusinessProcessContext.java:145)
              at org.jboss.seam.bpm.ManagedJbpmContext.beforeCompletion(ManagedJbpmContext.java:114)
              at org.hibernate.transaction.JDBCTransaction.notifyLocalSynchsBeforeTransactionCompletion(JDBCTransaction.java:228)
              at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:109)
              at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
              at org.jboss.seam.transaction.EntityTransaction.commit(EntityTransaction.java:109)
              at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:582)
              at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:325)
              at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:226)
              at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:184)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      



      Here is the relevant portion of my process definition:


      <start-state name="start">
            <transition to="beginOrder"/>
      </start-state>
      <task-node name="beginOrder">
            <task name="beginOrder" description="Begin Order">
               <assignment actor-id="sales"/>
            </task>
            <transition name="shop" to="shop"/>
            <transition name="backToConfirmation" to="confirm"/>
      </task-node>
      <task-node name="shop">
      .
      .
      .
      </task-node>
      



      Here is the relevant portion of my pages.xml:


      <page view-id="/sales/beginOrder.jspx">
            <begin-conversation join="true"/>
            <create-process definition="orderProcess"/>
            <begin-task pageflow="orderPageflow" />
      </page>
      



      Here is the button on my facelet:


      <h:commandButton id="shopButton" action="shop" value="Shop"/>
      



      And here is my pageflow that works alongside the process definition that you see referenced in the begin-task as orderPageflow:


      <start-page view-id="/sales/beginOrder.jspx" name="beginOrder">
            <description>Begin Order</description>
            <redirect/>
            <transition name="shop" to="shop"/>
            <transition name="backToConfirmation" to="confirm"/>
         </start-page>
      <page view-id="/sales/shop.jspx" name="shop">
      .
      .
      .
      </page>
      



      Please let me know if there is any other information I can provide. 


      Thanks for any insight.





        • 2. Re: Transaction Exception with JBPM and Seam on WebLogic 9.2
          Neil C Novice

          Ahhh...yes.  Forgot about that one.  Here is the jbpm.cfg.xml:


          <jbpm-configuration>
             <jbpm-context>
                <service name="persistence">
                   <factory>
                      <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
                         <field name="isTransactionEnabled">
                            <false/>
                         </field>
                      </bean>
                   </factory>
                </service>
                <service name="tx" factory="org.jbpm.tx.TxServiceFactory"/>
                <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory"/>
                <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>
          </jbpm-configuration>
          
          



          Here also are the settings in hibernate.cfg.xml:


          <property name="show_sql">true</property>
                <property name="connection.datasource">JBPM_DS</property>
                <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
                <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
                <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
                <property name="hibernate.hbm2ddl.auto">create-drop</property>
                <property name="hibernate.current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</property>
          



          I should point out that I am on WL 9.2, so I am using transaction-type="RESOURCE_LOCAL" in my persistence.xml file where I am defining my database access for the non-JBPM portion of the application.


          Thanks for any insight.


          • 5. Re: Transaction Exception with JBPM and Seam on WebLogic 9.2
            Xiaohong Zheng Newbie

            Have you resolved the issue? I've been trying to troubleshoot a similar problem for some time without any luck.