[jboss-user] [jBPM] - Re: InvocationTargetException when creating StatefulKnowledgeSession

Tim Kutz do-not-reply at jboss.com
Fri Mar 9 10:39:02 EST 2012


Tim Kutz [https://community.jboss.org/people/tim.kutz] created the discussion

"Re: InvocationTargetException when creating StatefulKnowledgeSession"

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

--------------------------------------------------------------
jtaManager is the JBoss TransactionManager (arjuna).  It's injected, as the class where the above code lives is actually an MBean.

I've made some - limited - progress with this.  It appears that the JPAKnowledgeService doesn't like to participate in an existing JTA transaction.  By marking the method with @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED), I am able to get a session created within a UserTransaction.  The code now looks like this:

UserTransaction txn = retrieveTransaction();
txn.begin();
kSession =
    JPAKnowledgeService.newStatefulKnowledgeSession( kBase, null, env );
kSession.getWorkItemManager().registerWorkItemHandler("ValidationService", new ValidationTaskWorkItemHandler());
kSession.getWorkItemManager().registerWorkItemHandler("SubscriptionEventUpdateService", new SubscriptionHistoryWorkItemHandler());
kSession.getWorkItemManager().registerWorkItemHandler("ImmunizationService", new JMSWorkItemHandler());
kSession.getWorkItemManager().registerWorkItemHandler("SchoolFormService", new JMSWorkItemHandler());
kSession.getWorkItemManager().registerWorkItemHandler("LegacySubscriptionService", new JMSWorkItemHandler());

I'm not thrilled about having to deal with UserTransaction, though.  Isn't this supposed to support standard managed transactions?  Is there something additional I need to provide to the env for it to participate normally?
--------------------------------------------------------------

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

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/20120309/14989662/attachment.html 


More information about the jboss-user mailing list