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.main(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/tr...
Each transaction framework has a different way to be configured, some
are simpler than others.
Mark
Cheers, Rob.