11 Replies Latest reply on Jun 29, 2012 4:59 PM by jnorris

    Exception retrieving task

    jnorris Newbie

      Hi All,

       

      I'm getting the exception shown below when trying to get a task using the Mina server in the demo task server included with the installer.  I've deployed and started a process definition that has a single human task in it.  A row is inserted into the TASK table in the Oracle 11g DB.  Other task tables with data are CONTENT (1 row), I18NText (2 rows), PEOPLEASSIGNMENTS_BAS (1 row - 'Administrator') and PEOPLEASSIGNMENTS_POTOWNERS (1 row - 'john').  One item of interest is that the column TASKINITIATOR_ID for the task is null.  User 'john' started the process and is the single ActorId in the process defintion.  Both the CREATEDBY_ID and ACTUALOWNER_ID columns for the task row are set to 'john'.

       

      Client code:

      String name = "ksclient-" + UUID.randomUUID();

      TaskClient client = new TaskClient( new MinaTaskClientConnector( name,                    new MinaTaskClientHandler( SystemEventListenerFactory.getSystemEventListener())));

      client.connect( "127.0.0.1", 9123 );

      Task jbpmTask = this.getTask( id.longValue() );

       

      utility method used in multiple places:

      public Task getTask( long taskId, TaskClient client )

      {

                BlockingGetTaskResponseHandler responseHandler = new BlockingGetTaskResponseHandler();

                client.getTask( taskId, responseHandler );

                responseHandler.waitTillDone( 1000 );

                return responseHandler.getTask();

      }

       

      Any help in resolving this would be appreciated.

       

      Jim

       

      Here's the exception:

           [java] Task service started correctly!

           [java] Task service running ...

           [java] Hibernate: select task0_.id as id11_3_, task0_.archived as archived11_3_, task0_.allowedToDelegate as allowedT3_11_3_, task0_.taskInitiator_id as taskIni27_11_3_, task0_.priority as priori

      ty11_3_, task0_.activationTime as activati5_11_3_, task0_.actualOwner_id as actualO28_11_3_, task0_.createdBy_id as createdBy29_11_3_, task0_.createdOn as createdOn11_3_, task0_.documentAccessType as

      document7_11_3_, task0_.documentContentId as document8_11_3_, task0_.documentType as document9_11_3_, task0_.expirationTime as expirat10_11_3_, task0_.faultAccessType as faultAc11_11_3_, task0_.faultC

      ontentId as faultCo12_11_3_, task0_.faultName as faultName11_3_, task0_.faultType as faultType11_3_, task0_.outputAccessType as outputA15_11_3_, task0_.outputContentId as outputC16_11_3_, task0_.outpu

      tType as outputType11_3_, task0_.parentId as parentId11_3_, task0_.previousStatus as previou19_11_3_, task0_.processId as processId11_3_, task0_.processInstanceId as process21_11_3_, task0_.processSes

      sionId as process22_11_3_, task0_.skipable as skipable11_3_, task0_.status as status11_3_, task0_.workItemId as workItemId11_3_, task0_.OPTLOCK as OPTLOCK11_3_, user1_.id as id6_0_, user2_.id as id6_1

      _, user3_.id as id6_2_ from Task task0_ left outer join OrganizationalEntity user1_ on task0_.taskInitiator_id=user1_.id left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id

      left outer join OrganizationalEntity user3_ on task0_.createdBy_id=user3_.id where task0_.id=?

           [java] org.apache.mina.filter.codec.ProtocolEncoderException: java.lang.NullPointerException

           [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:355)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:509)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:46)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:808)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:734)

           [java]     at org.apache.Hibernate: select names0_.Task_Names_Id as Task5_1_, names0_.id as id1_, names0_.id as id7_0_, names0_.language as language7_0_,mina.core.filterchain.DefaultIoFilterChain

      .callPreviousFilterWrite(DefaultIoFilterChain.java:509)

           [java]     at org.apache.mina.core.filt names0_.text as text7_0_ from I18NText names0_ where names0_.Task_Names_Id=?

           [java] Hibernate: select subjects0_.Task_Subjects_Id as erchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:501)

           [java]     at org.apache.mina.core.session.AbstractIoSession.Task4_1_, subjects0_.id as id1_, subjects0_.id as id7_0_, subjects0_.language as language7_0_, subjects0_.text as text7_0_ from write(

      AbstractIoSession.java:490)

           [java]     at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:435)

           [java]     at orgI18NText subjects0_ where subjects0_.Task_Subjects_Id=?

           [java] .jbpm.task.service.mina.MinaSessionWriter.write(MinaSessionWriter.java:31)

           [java]     at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:134)

           [java]     at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

           [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)

           [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

           [java]     at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:177)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

           [java]     at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

           [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

           [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)

           [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)

           [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)

           [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)

           [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)

           [java]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

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

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

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

           [java] Caused by: java.lang.NullPointerException

           [java]     at java.io.ObjectOutputStream$BlockDataOutputStream.getUTFLength(ObjectOutputStream.java:2106)

           [java]     at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:1977)

           [java]     at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:849)

           [java]     at org.jbpm.task.I18NText.writeExternal(I18NText.java:53)

           [java]     at org.jbpm.task.utils.CollectionUtils.writeI18NTextList(CollectionUtils.java:235)

           [java]     at org.jbpm.task.Task.writeExternal(Task.java:92)

           [java]     at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)

           [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)

           [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

           [java]     at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)

           [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)

           [java]     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

           [java]     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

           [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

           [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

           [java]     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

           [java]     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

           [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

           [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

           [java]     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

           [java]     at org.apache.mina.core.buffer.AbstractIoBuffer.putObject(AbstractIoBuffer.java:2011)

           [java]     at org.apache.mina.filter.codec.serialization.ObjectSerializationEncoder.encode(ObjectSerializationEncoder.java:80)

           [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:322)

           [java]     ... 36 more

        • 1. Re: Exception retrieving task
          jnorris Newbie

          BTW, the exception is on the server.  The client gets a timeout exception.

          • 2. Re: Exception retrieving task
            jnorris Newbie

            Also here's the basic code used to start the process instance:

             

            new JPAWorkingMemoryDbLogger( ksession );

            KnowledgeRuntimeLoggerFactory.newConsoleLogger( ksession );

            CommandBasedWSHumanTaskHandler wsHumanTaskHandler = new CommandBasedWSHumanTaskHandler( ksession );

            String name = "ksclient-" + UUID.randomUUID();

            TaskClient client = new TaskClient( new MinaTaskClientConnector( name, new MinaTaskClientHandler( SystemEventListenerFactory.getSystemEventListener())));

            client.connect( "127.0.0.1", 9123 );

            ksession.getWorkItemManager().registerWorkItemHandler( "Human Task", wsHumanTaskHandler );

            Map<String, Object> valueMap = getArrayListMap( properties );          // local method to format the valueMap from an input parameter list.

            ProcessInstance processInstance = ksession.startProcess( processDefinitionId, valueMap );

             

            I don't see a way to include the user kicking off the process so maybe that's why the TASKINITIATOR_ID column is null.

            Also, the CommandBasedWSHumanTaskHandler is deprecated.  Does anyone know what other class should be used?

             

            Thanks,

            Jim

            • 3. Re: Exception retrieving task
              Wen Ye Newbie

              you could use MinaHTWorkItemHandler, AsyncHornetQHTWorkItemHandler, or HornetQHTWorkItemHandler, AsyncHornetQHTWorkItemHandler.

              did you try the method getTasksAssignedAsPotentialOwner for retieving task?

              • 4. Re: Exception retrieving task
                jnorris Newbie

                I had issues with hornetq in the human task war file so I switched to the standalone mina server so I could test my application.  I changed the code to the following but still get an exception that appears to be an issue with the I18NText data.  After starting a process there are 2 rows added to that table and the TASK_SUBJECTS_ID column is null in the first one.

                 

                     [java] Hibernate: select subjects0_.Task_Subjects_Id as Task4_1_, subjects0_.id as id1_, subjects0_.id as id7_0_, subjects0_.language as language7_0_, subjects0_.text as text7_0_ from I18NText su

                bjects0_ where subjects0_.Task_Subjects_Id=?

                     [java] org.apache.mina.filter.codec.ProtocolEncoderException: java.lang.NullPointerException

                     [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:355)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:509)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:46)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:808)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:734)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:509)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:501)

                     [java]     at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:490)

                     [java]     at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:435)

                     [java]     at org.jbpm.task.service.mina.MinaSessionWriter.write(MinaSessionWriter.java:31)

                     [java]     at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:134)

                     [java]     at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                     [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)

                     [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                     [java]     at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:177)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                     [java]     at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                     [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

                     [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)

                     [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)

                     [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)

                     [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)

                     [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)

                     [java]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

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

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

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

                     [java] Caused by: java.lang.NullPointerException

                     [java]     at java.io.ObjectOutputStream$BlockDataOutputStream.getUTFLength(ObjectOutputStream.java:2106)

                     [java]     at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:1977)

                     [java]     at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:849)

                     [java]     at org.jbpm.task.I18NText.writeExternal(I18NText.java:53)

                     [java]     at org.jbpm.task.utils.CollectionUtils.writeI18NTextList(CollectionUtils.java:235)

                     [java]     at org.jbpm.task.Task.writeExternal(Task.java:92)

                     [java]     at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)

                     [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)

                     [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                     [java]     at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)

                     [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)

                     [java]     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

                     [java]     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

                     [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

                     [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                     [java]     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

                     [java]     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

                     [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

                     [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                     [java]     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

                     [java]     at org.apache.mina.core.buffer.AbstractIoBuffer.putObject(AbstractIoBuffer.java:2011)

                     [java]     at org.apache.mina.filter.codec.serialization.ObjectSerializationEncoder.encode(ObjectSerializationEncoder.java:80)

                     [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:322)

                • 5. Re: Exception retrieving task
                  jnorris Newbie

                  Also, I am trying to retrieve the task based on the task id:

                   

                  public Task getTask( long taskId )

                  {

                            BlockingGetTaskResponseHandler responseHandler = new BlockingGetTaskResponseHandler();

                            client.getTask( taskId, responseHandler );

                            responseHandler.waitTillDone( 1000 );

                            return responseHandler.getTask();

                  }

                  • 6. Re: Exception retrieving task
                    jnorris Newbie

                    Hi All,

                     

                    I'm pretty sure the issues with getting a task are due to the I18NText null values.  When a process is started a task is created.  There are also 2 rows created in the I18NText table.  The first row has a value for TASK_DESCRIPTIONS_ID and nulls for TASK_SUBJECTS_ID and TASK_NAMES_ID.  The second row has a value for TASK_SUBJECTS_ID and nulls for TASK_DESCRIPTIONS_ID and TASK_NAMES_ID.  I would think only one row would be created for a task.  Does anyone have a clue what's  going on?

                     

                    This is a critical issue for me and I have missed a deadline already because of it.

                     

                    I'd appreciate any help in resolving this matter.

                     

                    BTW, getting a list of tasks for a user works fine.  Any other methods such as getTask, claimTask, etc. all cause a null pointer exception to be thrown similar to the one included below:

                     

                    Jim

                     

                         [java] Hibernate: select subjects0_.Task_Subjects_Id as Task4_1_, subjects0_.id as id1_, subjects0_.id as id7_0_, subjects0_.language as language7_0_, subjects0_.text as text7_0_ from I18NText su

                    bjects0_ where subjects0_.Task_Subjects_Id=?

                         [java] org.apache.mina.filter.codec.ProtocolEncoderException: java.lang.NullPointerException

                         [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:355)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:509)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:46)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:808)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:734)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:509)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:501)

                         [java]     at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:490)

                         [java]     at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:435)

                         [java]     at org.jbpm.task.service.mina.MinaSessionWriter.write(MinaSessionWriter.java:31)

                         [java]     at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:134)

                         [java]     at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                         [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)

                         [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                         [java]     at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:177)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                         [java]     at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                         [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

                         [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)

                         [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)

                         [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)

                         [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)

                         [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)

                         [java]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

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

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

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

                         [java] Caused by: java.lang.NullPointerException

                         [java]     at java.io.ObjectOutputStream$BlockDataOutputStream.getUTFLength(ObjectOutputStream.java:2106)

                         [java]     at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:1977)

                         [java]     at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:849)

                         [java]     at org.jbpm.task.I18NText.writeExternal(I18NText.java:53)

                         [java]     at org.jbpm.task.utils.CollectionUtils.writeI18NTextList(CollectionUtils.java:235)

                         [java]     at org.jbpm.task.Task.writeExternal(Task.java:92)

                         [java]     at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)

                         [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)

                         [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                         [java]     at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)

                         [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)

                         [java]     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

                         [java]     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

                         [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

                         [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                         [java]     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

                         [java]     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

                         [java]     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

                         [java]     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                         [java]     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

                         [java]     at org.apache.mina.core.buffer.AbstractIoBuffer.putObject(AbstractIoBuffer.java:2011)

                         [java]     at org.apache.mina.filter.codec.serialization.ObjectSerializationEncoder.encode(ObjectSerializationEncoder.java:80)

                         [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:322)

                         [java]     ... 36 more

                    • 7. Re: Exception retrieving task
                      jnorris Newbie

                      I looked at the evaluation task and it appears to be creating 3 rows in the I18NText table for each task with the task ID in either the TASK_SUBJECT_ID, TASK_NAME_ID or TASK_DESCRIPTIONS column.  In my case I'm only getting 2 rows with the TASK_SUBJECTS_ID and TASK_DESCRIPTIONS columns with a value.  Since there is no name I'm sure that is causing the errors but don't know why the 3rd column is not created.

                      • 8. Re: Exception retrieving task
                        jnorris Newbie

                        Ok, I see why three rows were created in the demo web-apps, one for name, one for subject and one for description since the text value is stored in a single column.  I still don't know why only 2 rows are created in my application when starting a process.  BTW I'm using the junit test file used for testing a user task so it should be a valid bpmn2 file.

                        • 9. Re: Exception retrieving task
                          jnorris Newbie

                          Hi All,

                           

                          I still haven't been able to resolve the issue with exceptions on the task methods and really need some help.  When a start a process instance the I18NText row for the task name is not created.  I manually created the missing row and still get the exception shown in the first post.  The client code just before starting a process is slightly changed now:

                           

                          AsyncGenericHTWorkItemHandler wsHumanTaskHandler = new AsyncGenericHTWorkItemHandler ( ksession );

                          String name = "ksclient-" + UUID.randomUUID();

                          TaskClient client = new TaskClient( new MinaTaskClientConnector( name,

                                              new MinaTaskClientHandler( SystemEventListenerFactory.getSystemEventListener())));

                          wsHumanTaskHandler.setIpAddress( "127.0.0.1" );

                          wsHumanTaskHandler.setPort( 9123 );

                          wsHumanTaskHandler.setClient( client );

                          ksession.getWorkItemManager().registerWorkItemHandler( "Human Task", wsHumanTaskHandler );

                           

                          For the tasks method I have:

                          TaskClient taskClient = new TaskClient(

                              new MinaTaskClientConnector( name, new MinaTaskClientHandler( SystemEventListenerFactory.getSystemEventListener())));

                          taskClient.connect( "127.0.0.1", 9123 );

                          BlockingGetTaskResponseHandler responseHandler = new BlockingGetTaskResponseHandler();

                          client.getTask( taskId, responseHandler );

                          responseHandler.waitTillDone( 1000 );

                          return responseHandler.getTask();

                           

                          Does anyone see anything wrong with the above code?

                           

                          BTW, I took each hibernate query from the log and ran them with the parameters set to what they should be and each executed as expected.  If I knew how I would change the logging output to see if I could see what the parameters values actually are.

                           

                          Thanks,

                          Jim

                          • 10. Re: Exception retrieving task
                            jnorris Newbie

                            I changed the handler to AsyncMinaHTWorkItemHandler and now I am getting more detailed logging.  This is the log on the server when a process is started.  And indeed it looks like it is only inserting 2 rows in the I18NText table:

                             

                                 [java] Task service started correctly!

                                 [java] Task service running ...

                                 [java] Hibernate: select user0_.id as id6_0_ from OrganizationalEntity user0_ where user0_.id=? and user0_.DTYPE='User'

                                 [java] Hibernate: select user0_.id as id6_0_ from OrganizationalEntity user0_ where user0_.id=? and user0_.DTYPE='User'

                                 [java] Hibernate: select hibernate_sequence.nextval from dual

                                 [java] Hibernate: select user_.id from OrganizationalEntity user_ where user_.id=?

                                 [java] Hibernate: select I18NTEXT_ID_SEQ.nextval from dual

                                 [java] Hibernate: select I18NTEXT_ID_SEQ.nextval from dual

                                 [java] Hibernate: select CONTENT_ID_SEQ.nextval from dual

                                 [java] Hibernate: insert into Task (archived, allowedToDelegate, taskInitiator_id, priority, activationTime, actualOwner_id, createdBy_id, createdOn, documentAccessType, documentContentId, docume

                            ntType, expirationTime, faultAccessType, faultContentId, faultName, faultType, outputAccessType, outputContentId, outputType, parentId, previousStatus, processId, processInstanceId, processSessionId,

                            skipable, status, workItemId, OPTLOCK, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

                                 [java] Hibernate: insert into I18NText (language, text, id) values (?, ?, ?)

                                 [java] Hibernate: insert into I18NText (language, text, id) values (?, ?, ?)

                                 [java] 52125 29/06 16:46:40,984[NioProcessor-2] ERROR hibernate.util.JDBCExceptionReporter.logExceptions  - ORA-00001: unique constraint (JBPM_BOM_USR.SYS_C0020033) violated

                                 [java]

                                 [java] 52125 29/06 16:46:40,984[NioProcessor-2] ERROR hibernate.util.JDBCExceptionReporter.logExceptions  - ORA-00001: unique constraint (JBPM_BOM_USR.SYS_C0020033) violated

                                 [java]

                                 [java] 52125 29/06 16:46:40,984[NioProcessor-2] ERROR event.def.AbstractFlushingEventListener.performExecutions  - Could not synchronize database state with session

                                 [java] org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

                                 [java]     at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)

                                 [java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

                                 [java]     at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)

                                 [java]     at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114)

                                 [java]     at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)

                                 [java]     at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)

                                 [java]     at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2242)

                                 [java]     at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2678)

                                 [java]     at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)

                                 [java]     at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

                                 [java]     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

                                 [java]     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)

                                 [java]     at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

                                 [java]     at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)

                                 [java]     at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)

                                 [java]     at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)

                                 [java]     at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)

                                 [java]     at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)

                                 [java]     at org.jbpm.task.service.persistence.TaskLocalTransactionManager.commit(TaskLocalTransactionManager.java:55)

                                 [java]     at org.jbpm.task.service.persistence.TaskPersistenceManager.endTransaction(TaskPersistenceManager.java:86)

                                 [java]     at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:982)

                                 [java]     at org.jbpm.task.service.TaskServiceSession.addTask(TaskServiceSession.java:186)

                                 [java]     at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:144)

                                 [java]     at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                                 [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)

                                 [java]     at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                                 [java]     at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:177)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                                 [java]     at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                                 [java]     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

                                 [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)

                                 [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)

                                 [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)

                                 [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)

                                 [java]     at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)

                                 [java]     at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

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

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

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

                                 [java] Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (JBPM_BOM_USR.SYS_C0020033) violated

                            • 11. Re: Exception retrieving task
                              jnorris Newbie

                              The constraint being violated is a primary key constaint.  Despite the task not working the system still indicates that the process is started and puts an entry into the PROCESSINSTANCEINFO table.  Not good!