JBoss Community

StaleObjectStateException on jBPM 5.1 running on JBoss 6.1

created by Linh Pham in jBPM - View the full discussion

Hi All,

 

I got an intermittent StaleObjectStateException while completing a Human Task in jBPM. My current set up is as follows:

- Message Driven Bean processes a message, and invokes jBPM to complete a human task:

 

    @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)

    public void onMessage(Message message)

    {

        try

        {

               // pulling out the sessionId, workItemId, and resultsMap  from the message

            final StatefulKnowledgeSession ksession = ((JbpmLauncher) new InitialContext().lookup("java:module/JbpmLauncher")).getSession(sessionId);

            ksession.getWorkItemManager().completeWorkItem(inbound.getWorkItemId(), inbound.getResultsMap());

        }

        catch(NamingException e)

        {

            LOGGER.error("Encounterred exception", e);

            throw new WorkflowException("Unable to find the JBPM Launcher. ", e);    //WorkflowException is RuntimeException with @ApplicationException annotation.

        }

        catch(Exception e)

        {

            LOGGER.error("Encounterred exception", e);

            throw new WorkflowException(e);   //WorkflowException is RuntimeException with @ApplicationException annotation.

        }

    }

 

Intermittently, I got StaleObjectStateException and the stack trace is here: http://pastebin.com/HxUfSPh5

 

I am using jBPM 5.1, JBoss 6.1, the jbpm-ds.xml is XA datasource with transaction isolation of TRANSACTION_READ_COMMITTED.  JMS implementation is ActiveMQ with XA Datasource.

My environment is very low traffic, with just one user doing testing at the moment.

 

Is there a way to reliably reproduce the problem? And more importantly how can I get around this StaleObjectStateException?

 

Thanks for your help.

 

Linh

Reply to this message by going to Community

Start a new discussion in jBPM at Community