[rules-users] Exception using persistence
PAYET, Manuel
manuel.payet at capgemini.com
Mon May 31 07:48:40 EDT 2010
If your project is a J2SE one, you could use bitronix.
It's pretty easy to use.
-----Message d'origine-----
De : rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] De la part de Mark Proctor
Envoyé : lundi 31 mai 2010 02:55
À : rules-users at lists.jboss.org
Objet : Re: [rules-users] Exception using persistence
On 30/05/2010 20:28, Robert wrote:
> Hi, I followed the instructions on setting up the persistence in the
> drools flow doc, but I get the following exception:
>
>
> Exception in thread "main" java.lang.RuntimeException: Could not
> commit session
> at
> org.drools.persistence.session.SingleSessionCommandService.<init>(SingleSessionCommandService.java:133)
> at
> org.drools.persistence.jpa.impl.JPAKnowledgeServiceProviderImpl.newStatefulKnowledgeSession(JPAKnowledgeServiceProviderImpl.java:44)
> at
> org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:93)
> at
> com.rob.server.core.process.drools.tasks.DroolsProcessHandler.<init>(DroolsProcessHandler.scala:130)
> at
> com.rob.server.core.process.drools.tasks.StartDroolsProcessHandler$.main(DroolsProcessHandler.scala:33)
> at
> com.rob.server.core.process.drools.tasks.StartDroolsProcessHandler.mai
> n(DroolsProcessHandler.scala) Caused by:
> javax.naming.NameNotFoundException; remaining name 'UserTransaction'
> at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:576)
> at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:663)
> at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:678)
> at
> org.eclipse.jetty.jndi.java.javaRootURLContext.lookup(javaRootURLContext.java:110)
> at javax.naming.InitialContext.lookup(InitialContext.java:392)
> at
> org.drools.persistence.session.SingleSessionCommandService.<init>(SingleSessionCommandService.java:109)
> ... 5 more
>
>
> I have no idea what this means. I guess SingleSessionCommandService is
> looking up for "UserTransaction", but whats the "UserTransaction" ?
>
You need to configure JTA and JNDI, it uses the standard JNDI lookup mechanism to find the UserTransaction it's to be associated with. See javadocs example here:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/javadocs/stable/drools-api/org/drools/persistence/jpa/JPAKnowledgeService.html
Each transaction framework has a different way to be configured, some are simpler than others.
Mark
> Cheers, Rob.
>
>
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.
More information about the rules-users
mailing list