[jboss-user] [jBPM] - StaleObjectStateException on jBPM 5.1 running on JBoss 6.1

Linh Pham do-not-reply at jboss.com
Mon Mar 19 23:08:28 EDT 2012


Linh Pham [https://community.jboss.org/people/lpham1] created the discussion

"StaleObjectStateException on jBPM 5.1 running on JBoss 6.1"

To view the discussion, visit: https://community.jboss.org/message/724897#724897

--------------------------------------------------------------
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 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
[https://community.jboss.org/message/724897#724897]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120319/63b0270a/attachment-0001.html 


More information about the jboss-user mailing list