7 Replies Latest reply on Sep 23, 2014 8:10 AM by Yogesh Gupta

    error running ksession.startProcess with Persistence

    Odelya Holiday Novice

      When I run:

       

      ProcessInstance pi = ksession.startProcess("MyBookAcquiring",parameters);

       

      I get:

      2011-02-28 13:45:12,452 DEBUG (       SQLStatementLogger.java:111)     - select hibernate_sequence.nextval from dual

      2011-02-28 13:45:12,452 DEBUG (       SQLStatementLogger.java:111)     - select hibernate_sequence.nextval from dual

      Hibernate: select hibernate_sequence.nextval from dual

       

      ERROR (SingleSessionCommandService.java:319)     - Could not rollback

      java.lang.RuntimeException: Unable to rollback transaction

                at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:184)

                at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:317)

                at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:302)

                at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:219)

                at ws.process.BindBookProcessBindingImpl.startProcess(BindOnMediaProcessBindingImpl.java:27)

                at ws.process.BindBookProcessBindingSkeleton.startProcess(BindOnMediaProcessBindingSkeleton.java:68)

                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:597)

                at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)

                at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)

                at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)

                at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

                at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

                at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

                at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)

                at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

                at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

                at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)

                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

                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.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:857)

                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:662)

      Caused by: java.lang.IllegalStateException: no transaction started on this thread

                at bitronix.tm.BitronixTransactionManager.rollback(BitronixTransactionManager.java:103)

                at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:181)

       

      Why would I get it?

        • 1. error running ksession.startProcess with Persistence
          Mauricio Salatino Master

          Did you configure the transaction provider for your app?

          can you share that configuration?

          Greetings.

          • 2. error running ksession.startProcess with Persistence
            Odelya Holiday Novice

            My persistence.xml

            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

             

             

            <persistence version="1.0"

                      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"

                      xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                      xmlns="http://java.sun.com/xml/ns/persistence">

                      <persistence-unit name="org.drools.persistence.jpa" transaction-type="JTA">

                                <provider>org.hibernate.ejb.HibernatePersistence</provider>

                                <jta-data-source>java:comp/env/jdbc/testDS1</jta-data-source>

                                <mapping-file>persistenceorm.xml</mapping-file>

                                <class>org.drools.persistence.info.SessionInfo</class>

                                <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

                                <class>org.drools.persistence.info.WorkItemInfo</class>

                                <exclude-unlisted-classes>true</exclude-unlisted-classes>

                                <properties>

                                          <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />

                                          <property name="hibernate.connection.autocommit" value="false" />

                                          <property name="hibernate.max_fetch_depth" value="3" />

                                          <property name="hibernate.show_sql" value="true" />

                                          <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />

                                          <property name="hibernate.transaction.manager_lookup_class"

                                                    value="org.hibernate.transaction.BTMTransactionManagerLookup" />

                                </properties>

                      </persistence-unit>

             

             

                      <persistence-unit name="org.sintec.task">

             

                                <provider>org.hibernate.ejb.HibernatePersistence</provider>

                                <mapping-file>orm.xml</mapping-file>

             

                                <class>org.jbpm.task.Attachment</class>

                                <class>org.jbpm.task.Content</class>

                                <class>org.jbpm.task.BooleanExpression</class>

                                <class>org.jbpm.task.Comment</class>

                                <class>org.jbpm.task.Deadline</class>

                                <class>org.jbpm.task.Comment</class>

                                <class>org.jbpm.task.Deadline</class>

                                <class>org.jbpm.task.Delegation</class>

                                <class>org.jbpm.task.Escalation</class>

                                <class>org.jbpm.task.Group</class>

                                <class>org.jbpm.task.I18NText</class>

                                <class>org.jbpm.task.Notification</class>

                                <class>org.jbpm.task.EmailNotification</class>

                                <class>org.jbpm.task.EmailNotificationHeader</class>

                                <class>org.jbpm.task.PeopleAssignments</class>

                                <class>org.jbpm.task.Reassignment</class>

                                <class>org.jbpm.task.Status</class>

                                <class>org.jbpm.task.Task</class>

                                <class>org.jbpm.task.TaskData</class>

                                <class>org.jbpm.task.SubTasksStrategy</class>

                                <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

                                <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

             

             

                                <class>org.jbpm.task.User</class>

             

             

                                <class>org.drools.persistence.info.SessionInfo</class>

                          <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

                          <class>org.drools.persistence.info.WorkItemInfo</class>

                                <exclude-unlisted-classes>true</exclude-unlisted-classes>

             

             

                                <properties>

                                          <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />

                                          <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />

                                          <property name="hibernate.connection.url" value="jdbc:oracle:thin:@myserver:1523:mydb" />

                                          <property name="hibernate.connection.username" value="workflow_cust" />

                                          <property name="hibernate.connection.password" value="workflow_cust" />

                                          <property name="hibernate.connection.autocommit" value="false" />

                                          <property name="hibernate.max_fetch_depth" value="3" />

                                          <property name="hibernate.show_sql" value="false" />

                                </properties>

                      </persistence-unit>

            </persistence>

             

            my orm.xml

             

            <?xml version="1.0" encoding="UTF-8"?>

            <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"

                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                           xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"

                           version="1.0">

                           <named-query name="ProcessInstancesWaitingForEvent">

                      <query>

            select

                processInstanceInfo.processInstanceId

            from

                ProcessInstanceInfo processInstanceInfo

            where

                :type in elements(processInstanceInfo.eventTypes)

                      </query>

                  </named-query>

                  <named-query name="TasksAssignedAsBusinessAdministrator">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy,

                I18NText names,

                I18NText subjects,

                I18NText descriptions,

                OrganizationalEntity businessAdministrator

            where

                businessAdministrator.id = :userId and

                businessAdministrator in elements ( t.peopleAssignments.businessAdministrators  )  and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

                  <named-query name="TasksAssignedAsExcludedOwner">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy,

                I18NText names,

                I18NText subjects,

                I18NText descriptions,

                OrganizationalEntity excludedOwners

            where

                excludedOwners.id = :userId and

                excludedOwners in elements ( t.peopleAssignments.excludedOwners  )  and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

                  <named-query name="TasksAssignedAsPotentialOwner">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subject.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t

                left join t.taskData.createdBy

                left join t.taskData.actualOwner

                left join t.subjects as subject,

                I18NText names,

                I18NText descriptions,

                OrganizationalEntity potentialOwners

            where

                potentialOwners.id = :userId and

                potentialOwners in elements ( t.peopleAssignments.potentialOwners  )  and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subject.language = :language

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

             

             

             

             

             

             

                t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

                        <named-query name="TasksAssignedAsPotentialOwnerWithGroups">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy left join t.taskData.actualOwner,

                I18NText names,

                I18NText subjects,

                I18NText descriptions,

                OrganizationalEntity potentialOwners

            where

                ( potentialOwners.id = :userId or potentialOwners.id in (:groupIds) ) and

                potentialOwners in elements ( t.peopleAssignments.potentialOwners )  and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

             

             

                   <named-query name="TasksAssignedAsPotentialOwnerByGroup">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy left join t.taskData.actualOwner,

                I18NText names,

                I18NText subjects,

                I18NText descriptions,

                OrganizationalEntity potentialOwners

            where

                potentialOwners.id = :groupId and

                potentialOwners in elements ( t.peopleAssignments.potentialOwners  )  and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

             

             

                  <named-query name="SubTasksAssignedAsPotentialOwner">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy left join t.taskData.actualOwner,

                I18NText names,

                I18NText subjects,

                I18NText descriptions,

                OrganizationalEntity potentialOwners

            where

                t.taskData.parentId = :parentId and

                potentialOwners.id = :userId and

                potentialOwners in elements ( t.peopleAssignments.potentialOwners  )  and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

             

             

            <named-query name="GetSubTasksByParentTaskId">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t,

                I18NText names,

                I18NText subjects,

                I18NText descriptions

             

             

            where

                t.taskData.parentId = :parentId and

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

             

             

             

             

                  <named-query name="TasksAssignedAsRecipient">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy,

                I18NText names,

                I18NText subjects,

                I18NText descriptions,

                OrganizationalEntity recipients

            where

                recipients.id = :userId and

                recipients in elements ( t.peopleAssignments.recipients  )  and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

                  <named-query name="TasksAssignedAsTaskInitiator">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy,

                I18NText names,

                I18NText subjects,

                I18NText descriptions,

                OrganizationalEntity taskInitiator

            where

                taskInitiator.id = :userId and

                taskInitiator = t.peopleAssignments.taskInitiator and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

                  <named-query name="TasksAssignedAsTaskStakeholder">

                      <query>

            select

                 new org.jbpm.task.query.TaskSummary(

                 t.id,

                 t.taskData.processInstanceId,

                 names.text,

                 subjects.text,

                 descriptions.text,

                 t.taskData.status,

                 t.priority,

                 t.taskData.skipable,

                 t.taskData.actualOwner,

                 t.taskData.createdBy,

                 t.taskData.createdOn,

                 t.taskData.activationTime,

                 t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy,

                I18NText names,

                I18NText subjects,

                I18NText descriptions,

                OrganizationalEntity taskStakeholder

            where

                taskStakeholder.id = :userId and

                taskStakeholder in elements ( t.peopleAssignments.taskStakeholders  )  and

             

             

                names.language = :language and

                names in elements( t.names) and

             

             

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

                  <named-query name="TasksOwned">

                      <query>

            select

                new org.jbpm.task.query.TaskSummary(

                t.id,

                t.taskData.processInstanceId,

                names.text,

                subjects.text,

                descriptions.text,

                t.taskData.status,

                t.priority,

                t.taskData.skipable,

                t.taskData.actualOwner,

                t.taskData.createdBy,

                t.taskData.createdOn,

                t.taskData.activationTime,

                t.taskData.expirationTime)

            from

                Task t left join t.taskData.createdBy,

                I18NText names,

                I18NText subjects,

                I18NText descriptions

            where

                t.taskData.actualOwner.id = :userId and

                names in elements( t.names) and

                names.language = :language and

                         

                (

                subjects.language = :language and

                subjects in elements( t.subjects)

                or t.subjects.size = 0

                ) and

             

             

                (

                descriptions.language = :language and

                descriptions in elements( t.descriptions)

                or t.descriptions.size = 0

                ) and

             

             

                t.taskData.expirationTime is null

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

                        <named-query name="UnescalatedDeadlines">

                      <query>

            select

                 new org.jbpm.task.query.DeadlineSummary(

                 t.id,

                 d.id,

                 d.date)

            from

                Task t,

                Deadline d

            where

                (d in elements( t.deadlines.startDeadlines ) or d in elements( t.deadlines.endDeadlines ) ) and

                d.escalated = false

            order by

                d.date

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

                  <named-query name="TaskByWorkItemId">

                      <query>

            select

                t

            from

                Task t

            where

                t.taskData.workItemId = :workItemId

                      </query>

                      <!-- hint name="org.hibernate.timeout" value="200"/ -->

                  </named-query>

            </entity-mappings>

             

            my persistenceorm.xml

             

            <?xml version="1.0" encoding="UTF-8"?>

            <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"

                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                           xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"

                           version="1.0">

                           <named-query name="ProcessInstancesWaitingForEvent">

                      <query>

            select

                processInstanceInfo.processInstanceId

            from

                ProcessInstanceInfo processInstanceInfo

            where

                :type in elements(processInstanceInfo.eventTypes)

                      </query>

                  </named-query>

            </entity-mappings>

             

             

            i am using tomcat so I added under web content/META_INF file context.xml:

             

            <WatchedResource>WEB-INF/web.xml</WatchedResource>

                       <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />

                 <Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"

                           maxActive="15" maxIdle="2" maxWait="10000"

                           logAbandoned="true"

                           username="workflow_cust" password="workflow_cust"

                           driverClassName="oracle.jdbc.OracleDriver"

                           url="jdbc:oracle:thin:@myserver:1523:mydb"/>

             

            and resources.properties:

             

            resource.ds1.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource

            resource.ds1.uniqueName=jdbc/testDS1

            resource.ds1.minPoolSize=0

            resource.ds1.maxPoolSize=5

            resource.ds1.driverProperties.driverClassName=oracle.jdbc.OracleDriver

             

            • 3. error running ksession.startProcess with Persistence
              Mauricio Salatino Master

              what about your java code where do you configure the Environment for the JPAKnowledgeService?

              1 of 1 people found this helpful
              • 4. error running ksession.startProcess with Persistence
                Odelya Holiday Novice

                sure:

                 

                 

                EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");

                                    Environment env = KnowledgeBaseFactory.newEnvironment();

                                    env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

                                    env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());

                                    env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());

                                    ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);

                 

                I also updated my first post with the SQL that causes it

                • 5. error running ksession.startProcess with Persistence
                  Mauricio Salatino Master

                  I'm guessing here that the problem could be related with:

                  driverClassName="oracle.jdbc.OracleDriver"

                   

                  Look for the XA driver for Oracle.

                  Same here:

                  <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />

                  1 of 1 people found this helpful
                  • 6. Re: error running ksession.startProcess with Persistence
                    Odelya Holiday Novice

                    Ah.. I just found my problem.

                     

                    I wasn't wrapping it with :

                     

                    ut = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
                    

                     

                    to start and stop it.!

                     

                    And the errors in Drools are hard to understand!

                     

                    I just emailed drools rules group about it and I was told that there is a bug here:

                     

                    https://issues.jboss.org/browse/JBRULES-2656

                     

                    I wish Drools exception could be more helpful like Spring's

                     

                    Message was edited by: Odelya Holiday

                    • 7. Re: error running ksession.startProcess with Persistence
                      Yogesh Gupta Newbie

                      Dear Odelya,

                       

                      I'm facing the similar issue and my stack trace is :

                       

                      Sep 23, 2014 4:29:27 PM org.drools.persistence.SingleSessionCommandService rollbackTransaction

                      SEVERE: Could not commit session

                      org.hibernate.SessionException: Session is closed!

                              at org.hibernate.internal.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:129)

                              at org.hibernate.internal.SessionImpl.getTransactionCoordinator(SessionImpl.java:2008)

                              at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1208)

                              at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1183)

                              at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:382)

                              at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:350)

                              at $Proxy646.joinTransaction(Unknown Source)

                              at org.drools.persistence.jpa.JpaPersistenceContext.joinTransaction(JpaPersistenceContext.java:37)

                              at org.drools.container.spring.beans.persistence.DroolsSpringJpaManager.beginCommandScopedEntityManager(DroolsSpringJpaManager.java:116)

                              at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:362)

                              at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)

                              at com.cmc.jbpm.ProcessEngine.startProcess(ProcessEngine.java:49)

                              at com.cmc.common.jbpmservice.impl.JbpmServiceImpl.initiateWorkflowJbpm(JbpmServiceImpl.java:38)

                              at com.cmc.marriagegift.controllerservice.MarriageGiftJbpmActionService.createProcess(MarriageGiftJbpmActionService.java:122)

                              at sun.reflect.GeneratedMethodAccessor570.invoke(Unknown Source)

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                              at java.lang.reflect.Method.invoke(Method.java:597)

                              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

                              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

                              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

                              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)

                              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

                              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

                              at $Proxy675.createProcess(Unknown Source)

                              at com.cmc.marriagegift.controller.MarriageGiftJbpmActionController.createProcess(MarriageGiftJbpmActionController.java:79)

                              at sun.reflect.GeneratedMethodAccessor567.invoke(Unknown Source)

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                              at java.lang.reflect.Method.invoke(Method.java:597)

                              at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)

                              at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)

                              at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)

                              at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:746)

                              at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:687)

                              at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)

                              at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)

                              at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)

                              at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)

                              at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:822)

                              at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)

                              at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)

                              at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

                              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

                              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)

                              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)

                              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

                              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

                              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

                              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)

                              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

                              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)

                              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)

                              at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                              at java.lang.Thread.run(Thread.java:662)

                       

                       

                       

                       

                      Please help me to solve this .

                      Thanks in advance.