[jboss-user] [jBPM] - jBPM 5.0.1 Configuring persistence
Jim Hill
do-not-reply at jboss.com
Tue May 10 15:40:21 EDT 2011
Jim Hill [http://community.jboss.org/people/jdh] created the discussion
"jBPM 5.0.1 Configuring persistence"
To view the discussion, visit: http://community.jboss.org/message/604549#604549
--------------------------------------------------------------
I am converting my jBPM 4.4 code over to use 5.0.1 and am trying to configure persistence. When I run my unit tests to see if everything is working as it did in 4.4 I am getting this error:
No Persistence provider for EntityManager named org.jbpm.persistence.jpa
See the end for the full stack trace. I have been following the user guide and configured a datasource.xml file and set up the EntityManagerFactory and used it in the creation of the KnowledgeSession. What am I still missing? Any help would be appreciated.
Jim
EntityManagerFactory emf =
Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
Collection<StatefulKnowledgeSession> ksConfigs =
kbase.getStatefulKnowledgeSessions();
if (!ksConfigs.isEmpty()) {
KnowledgeSessionConfiguration[] sessionArray =
(KnowledgeSessionConfiguration[])ksConfigs.toArray();
if (ksConfigs.size() == 1) {
sessionConfig = sessionArray[0];
}
if (ksConfigs.size() > 1) {
throw new Exception("More than one KnowledgeSessionConfiguration" +
" object exists. We were only expecting one");
}
}
if (ksession == null) {
ksession = kbase.newStatefulKnowledgeSession(sessionConfig, env );
}
Stack Trace:
"Exception in constructor: testStartProcess (java.lang.ExceptionInInitializerError
at xxxxxxxxxxxxxxxxxxxxxxxxxx.SelectiveConsumerTest.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at junit.framework.TestSuite.createTest(TestSuite.java:61)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:283)
at junit.framework.TestSuite.<init>(TestSuite.java:146)
at org.junit.internal.runners.JUnit38ClassRunner.<init>(JUnit38ClassRunner.java:67)
at org.junit.internal.builders.JUnit3Builder.runnerForClass(JUnit3Builder.java:14)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at junit.framework.JUnit4TestAdapter.<init>(JUnit4TestAdapter.java:31)
at junit.framework.JUnit4TestAdapter.<init>(JUnit4TestAdapter.java:24)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:386)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named org.jbpm.persistence.jpa
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at xxxxxxxxxxxxxxxxxxxxxxxxxx.SelectiveConsumer<init>(Unknown Source)
at xxxxxxxxxxxxxxxxxxxxxxxxxx.SelectiveConsumer<clinit>(Unknown Source)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/604549#604549]
Start a new discussion in jBPM at Community
[http://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/20110510/564f711c/attachment-0001.html
More information about the jboss-user
mailing list