0 Replies Latest reply on May 5, 2016 2:33 AM by David Lee

    Jbpm6-missing two "update" sql when execute ksession.startProcess

    David Lee Newbie

      Hi,everybody!

      I have a process with only one User Task Node,It runs perfectly on Eclipse.But when running on tomcat8 and completing the task by executing “taskService.complete(task.getId(), "john", null);" ,the console shows as follows. I found that there are two "update" sqls missing when executing "ksession.startProcess("com.sample.bpmn.hello");" They are:

       

      Hibernate: update ProcessInstanceInfo set lastModificationDate=?, lastReadDate=?, processId=?, processInstanceByteArray=?, startDate=?, state=?, OPTLOCK=? where InstanceId=? and OPTLOCK=?

      Hibernate: update WorkItemInfo set creationDate=?, name=?, processInstanceId=?, state=?, OPTLOCK=?, workItemByteArray=? where workItemId=? and OPTLOCK=?

       

      I think that is the cause because processInstanceByteArray and processInstanceByteArray are "null" in H2 database.However,I have no idea how to solve it.

      Thanks in advance for any help.

       

      java.lang.NullPointerException
      at java.io.ByteArrayInputStream.<init>(Unknown Source)
      at org.drools.persistence.info.WorkItemInfo.getWorkItem(WorkItemInfo.java:116)
      at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalGetWorkItem(JPAWorkItemManager.java:213)
      at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:141)
      at org.drools.core.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:75)
      at org.drools.core.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:35)
      at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:584)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
      at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:377)
      at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:152)
      at org.jbpm.services.task.wih.ExternalTaskEventListener.processTaskState(ExternalTaskEventListener.java:78)
      at org.jbpm.services.task.wih.ExternalTaskEventListener.afterTaskCompletedEvent(ExternalTaskEventListener.java:120)
      at org.jbpm.services.task.events.TaskEventSupport.fireAfterTaskCompleted(TaskEventSupport.java:226)
      at org.jbpm.services.task.internals.lifecycle.MVELLifeCycleManager.taskOperation(MVELLifeCycleManager.java:387)
      at org.jbpm.services.task.impl.TaskInstanceServiceImpl.complete(TaskInstanceServiceImpl.java:186)
      at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:76)
      at org.jbpm.services.task.commands.CompleteTaskCommand.execute(CompleteTaskCommand.java:39)
      at org.jbpm.services.task.commands.CompositeCommand.execute(CompositeCommand.java:146)
      at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:69)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)
      at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)
      at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)
      at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40)
      at org.jbpm.services.task.impl.command.CommandBasedTaskService.complete(CommandBasedTaskService.java:173)
      at org.jbpm.runtime.manager.impl.task.SynchronizedTaskService.complete(SynchronizedTaskService.java:133)
      at com.sample.HelloServlet.startweb(HelloServlet.java:74)
      at com.sample.HelloServlet.receive(HelloServlet.java:50)
      at com.sample.HelloServlet.doGet(HelloServlet.java:40)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)

      ###################

       

      My persistence.xml:

      <persistence
        version="2.0"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
                            http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_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.jbpm.persistence.jpa" transaction-type="JTA">
          <provider>org.hibernate.ejb.HibernatePersistence</provider>
          <jta-data-source>java:comp/env/jdbc/jbpm-ds</jta-data-source>       
         
          <mapping-file>META-INF/JBPMorm.xml</mapping-file>
          <mapping-file>META-INF/Taskorm.xml</mapping-file>
          <mapping-file>META-INF/TaskAuditorm.xml</mapping-file>
         
          <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
          <class>org.drools.persistence.info.SessionInfo</class>
          <class>org.drools.persistence.info.WorkItemInfo</class>

          <class>org.jbpm.process.audit.ProcessInstanceLog</class>
          <class>org.jbpm.process.audit.NodeInstanceLog</class>
          <class>org.jbpm.process.audit.VariableInstanceLog</class>
         
          <class>org.jbpm.persistence.correlation.CorrelationKeyInfo</class>
          <class>org.jbpm.persistence.correlation.CorrelationPropertyInfo</class>
         
          <!-- manager -->
          <class>org.jbpm.runtime.manager.impl.jpa.ContextMappingInfo</class>
         
          <class>org.jbpm.services.task.impl.model.AttachmentImpl</class>
          <class>org.jbpm.services.task.impl.model.ContentImpl</class>
          <class>org.jbpm.services.task.impl.model.BooleanExpressionImpl</class>
          <class>org.jbpm.services.task.impl.model.CommentImpl</class>
          <class>org.jbpm.services.task.impl.model.DeadlineImpl</class>
          <class>org.jbpm.services.task.impl.model.DelegationImpl</class>
          <class>org.jbpm.services.task.impl.model.EscalationImpl</class>
          <class>org.jbpm.services.task.impl.model.GroupImpl</class>
          <class>org.jbpm.services.task.impl.model.I18NTextImpl</class>
          <class>org.jbpm.services.task.impl.model.NotificationImpl</class>
          <class>org.jbpm.services.task.impl.model.EmailNotificationImpl</class>
          <class>org.jbpm.services.task.impl.model.EmailNotificationHeaderImpl</class>
          <class>org.jbpm.services.task.impl.model.PeopleAssignmentsImpl</class>
          <class>org.jbpm.services.task.impl.model.ReassignmentImpl</class>
         
          <class>org.jbpm.services.task.impl.model.TaskImpl</class>
          <class>org.jbpm.services.task.impl.model.TaskDataImpl</class>
          <class>org.jbpm.services.task.impl.model.UserImpl</class>
         
          <!--BAM for task service -->
          <class>org.jbpm.services.task.audit.impl.model.BAMTaskSummaryImpl</class>
         
          <!-- Event Classes -->
          <class>org.jbpm.services.task.audit.impl.model.TaskEventImpl</class>
         
          <!-- Task Audit Classes -->
          <class>org.jbpm.services.task.audit.impl.model.AuditTaskImpl</class>
         
          <properties>
            <property name="hibernate.max_fetch_depth" value="3"/>
            <property name="hibernate.hbm2ddl.auto" value="update" />
            <property name="hibernate.show_sql" value="true" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>

            <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->     
            <property name="hibernate.id.new_generator_mappings" value="false" />           

            <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform" />
          </properties>       
        </persistence-unit>
         
      </persistence>