0 Replies Latest reply on Dec 30, 2010 7:16 AM by Paulo Costa

    seam 2.2 with jbpm on tomcat6 ERROR - exception calling user Synchronization java.lang.IllegalStateException: Transaction already active

    Paulo Costa Newbie
      Dear Sirs.

      I have a tomcat6 seam 2.2 project and it works fine.
      I would like to embedded jbpm on it.

        I have the jbpm 3.2.7. and i have configured the

      hibernate.cfg.xml like:
       

      `
          <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>

          <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
          <property name="hibernate.connection.url">jdbc:oracle:thin:@132.10.18.248:1521:siga</property>
          <property name="hibernate.connection.username">seamt</property>
          <property name="hibernate.connection.password">seamt</property> -->

          <!-- JDBC connection properties (end) -->
          <!-- DataSource properties (begin) -->
          <property name="hibernate.connection.datasource">java:comp/env/jdbc/SigaDS</property>
          <!--  DataSource properties (end) -->

      `

      jbpm.cfg.xml like:

      <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>


      components.xml like:

      <persistence:entity-manager-factory name="entityManagerFactory" persistence-unit-name="SigaDS"/>
      <persistence:managed-persistence-context auto-create="true"
        entity-manager-factory="#{entityManagerFactory}" name="entityManager"/>

      persistence.xml like:
            <persistence-unit name="SigaDS" transaction-type="RESOURCE_LOCAL">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>     
            <non-jta-data-source>java:comp/env/jdbc/SigaDS</non-jta-data-source>


      context.xml like:
      <Context path="/siga" docBase="siga" debug="5" reloadable="true"
      crossContext="true">


      <Resource   name="jdbc/SigaDS"
                              driverClassName="oracle.jdbc.driver.OracleDriver"
                              url="jdbc:oracle:thin:@132.10.18.248:1521:siga"
                              username="SEAMT" password="SEAMT"
                              oracle.jdbc.V8Compatible="true" 
                              auth="Container"
                              maxActive="20"
                              maxIdle="10"
                              maxWait="100"
                              type="javax.sql.DataSource"/>
                             
      </Context>


      And i Was doing some test with the process i'm stuck with this error:



      I was doing some test but it came this error and i'm looking for help :

      DEBUG -
          /* named HQL query TaskMgmtSession.findTaskInstancesByActorId */ select
              taskinstan0_.ID_ as ID1_507_,
              taskinstan0_.VERSION_ as VERSION3_507_,
              taskinstan0_.NAME_ as NAME4_507_,
              taskinstan0_.DESCRIPTION_ as DESCRIPT5_507_,
              taskinstan0_.ACTORID_ as ACTORID6_507_,
              taskinstan0_.CREATE_ as CREATE7_507_,
              taskinstan0_.START_ as START8_507_,
              taskinstan0_.END_ as END9_507_,
              taskinstan0_.DUEDATE_ as DUEDATE10_507_,
              taskinstan0_.PRIORITY_ as PRIORITY11_507_,
              taskinstan0_.ISCANCELLED_ as ISCANCE12_507_,
              taskinstan0_.ISSUSPENDED_ as ISSUSPE13_507_,
              taskinstan0_.ISOPEN_ as ISOPEN14_507_,
              taskinstan0_.ISSIGNALLING_ as ISSIGNA15_507_,
              taskinstan0_.ISBLOCKING_ as ISBLOCKING16_507_,
              taskinstan0_.TASK_ as TASK17_507_,
              taskinstan0_.TOKEN_ as TOKEN18_507_,
              taskinstan0_.PROCINST_ as PROCINST19_507_,
              taskinstan0_.SWIMLANINSTANCE_ as SWIMLAN20_507_,
              taskinstan0_.TASKMGMTINSTANCE_ as TASKMGM21_507_
          from
              JBPM_TASKINSTANCE taskinstan0_
          where
              taskinstan0_.ACTORID_=?
              and taskinstan0_.ISSUSPENDED_=0
              and taskinstan0_.ISOPEN_=1
      TRACE - binding 'demo' to parameter: 1
      TRACE - returning '18' as column: ID1_507_
      ERROR - 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:82)
            at org.jboss.seam.util.Work.workInTransaction(Work.java:44)
            at org.jboss.seam.bpm.ProcessInstance.getProcessInstance(ProcessInstance.java:39)
            at sun.reflect.GeneratedMethodAccessor282.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
            at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
            at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
            at org.jboss.seam.Component.unwrap(Component.java:2275)
            at org.jboss.seam.Component.getInstance(Component.java:2041)
            at org.jboss.seam.Component.getInstance(Component.java:2000)
            at org.jboss.seam.Component.getInstance(Component.java:1994)
            at org.jboss.seam.Component.getInstance(Component.java:1967)
            at org.jboss.seam.Component.getInstance(Component.java:1962)
            at org.jboss.seam.bpm.ProcessInstance.instance(ProcessInstance.java:65)
            at org.jboss.seam.contexts.BusinessProcessContext.getProcessInstance(BusinessProcessContext.java:229)
            at org.jboss.seam.contexts.BusinessProcessContext.flush(BusinessProcessContext.java:160)
            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:110)
            at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:613)
            at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:604)
            at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:345)
            at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:245)
            at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
            at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
            at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
            at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
            at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
            at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
            at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
            at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
            at java.lang.Thread.run(Thread.java:595)
      ERROR - 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:82)
            at org.jboss.seam.util.Work.workInTransaction(Work.java:44)
            at org.jboss.seam.bpm.ProcessInstance.getProcessInstance(ProcessInstance.java:39)
            at sun.reflect.GeneratedMethodAccessor282.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
            at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
            at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
            at org.jboss.seam.Component.unwrap(Component.java:2275)
            at org.jboss.seam.Component.getInstance(Component.java:2041)
            at org.jboss.seam.Component.getInstance(Component.java:2000)
            at org.jboss.seam.Component.getInstance(Component.java:1994)
            at org.jboss.seam.Component.getInstance(Component.java:1967)
            at org.jboss.seam.Component.getInstance(Component.java:1962)
            at org.jboss.seam.bpm.ProcessInstance.instance(ProcessInstance.java:65)
            at org.jboss.seam.contexts.BusinessProcessContext.getProcessInstance(BusinessProcessContext.java:229)
            at org.jboss.seam.contexts.BusinessProcessContext.flush(BusinessProcessContext.java:160)
            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:110)
            at org.jboss.seam.util.Work.workInTransaction(Work.java:58)
            at org.jboss.seam.bpm.ProcessInstance.getProcessInstance(ProcessInstance.java:39)
            at sun.reflect.GeneratedMethodAccessor282.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
            at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
            at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
            at org.jboss.seam.Component.unwrap(Component.java:2275)
            at org.jboss.seam.Component.getInstance(Component.java:2041)
            at org.jboss.seam.Component.getInstance(Component.java:2000)
            at org.jboss.seam.Component.getInstance(Component.java:1994)
            at org.jboss.seam.Component.getInstance(Component.java:1967)
            at org.jboss.seam.Component.getInstance(Component.java:1962)
            at org.jboss.seam.bpm.ProcessInstance.instance(ProcessInstance.java:65)
            at org.jboss.seam.bpm.BusinessProcess.hasActiveProcess(BusinessProcess.java:64)
            at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:347)
            at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
            at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:514)
            at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:249)
            at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
            at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
            at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
            at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
            at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
            at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
            at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
            at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
            at java.lang.Thread.run(Thread.java:595)
      DEBUG -

      Thanks in advance, if someone can help me.
      Paulo