[jboss-user] [jBPM] - JTA issue when starting a process from another thread

Gareth Edwards do-not-reply at jboss.com
Thu Apr 4 07:25:11 EDT 2013


Gareth Edwards [https://community.jboss.org/people/garethed] created the discussion

"JTA issue when starting a process from another thread"

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

--------------------------------------------------------------
Hello,

I have a queue of objects which contain all the information required to start a new process session.
Using Spring's @Scheduled annotation I'm periodically calling a method to poll the queue and start new workflows running.
The problem is because of the scheduling the method is called using another thread and the following error below occurs:


{code}
Caused by: java.lang.IllegalStateException: Unable to find transaction: java:comp/UserTransaction
          at org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:124) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]
          at org.drools.persistence.jta.JtaTransactionManager.<init>(JtaTransactionManager.java:69) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]
          at org.drools.persistence.SingleSessionCommandService.initTransactionManager(SingleSessionCommandService.java:303) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]
          at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:117) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]
          ... 24 more
Caused by: javax.naming.NameNotFoundException: java:comp/UserTransaction
          at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:121)
          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)
          at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_10]
          at org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:119) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]
          ... 27 more
{code}

I'm using jbpm 5.4 and JBoss 7.1

I have read that using java:jboss/TransactionManager instead can resolve this issue but java:comp/UserTransaction is hard coded in the drools-persistence-jpa jar.
Do I need to download the source and build another version of the jar?
There must be a simple work around for this.

Thanks in advance.

Gareth.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/806432#806432]

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/20130404/21ba5a21/attachment.html 


More information about the jboss-user mailing list