[jboss-user] [jBPM] - MapBasedPersistenceTest issue

Donald Walters do-not-reply at jboss.com
Tue Oct 25 11:38:52 EDT 2011


Donald Walters [http://community.jboss.org/people/dondragon2] created the discussion

"MapBasedPersistenceTest issue"

To view the discussion, visit: http://community.jboss.org/message/633511#633511

--------------------------------------------------------------
I am tring to use the MapPersistence instead of a database underlying the JPAKnowledgeService but I keep getting an exception. I have done the setup according to the MapBasedPersistenceTest

What could I be doing wrong here?

StatefulKnowledgeSession ksession = newStatefulKnowledgeSession();
WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.startProcess("ServiceProcess", params); //<==exception

public static StatefulKnowledgeSession newStatefulKnowledgeSession() {

        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        kbuilder.add(ResourceFactory.newClassPathResource("workflowtest/MyProcess.xml"), ResourceType.BPMN2);

        KnowledgeBase kbase = kbuilder.newKnowledgeBase();

        EnvironmentBuilder envBuilder = new KnowledgeSessionStorageEnvironmentBuilder(storage);
        Environment env = KnowledgeBaseFactory.newEnvironment();
        env.set(EnvironmentName.TRANSACTION_MANAGER, envBuilder.getTransactionManager());
        env.set(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, envBuilder.getPersistenceContextManager());

        return JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
}

===================================================
java.lang.ClassCastException: org.drools.persistence.map.MapPersistenceContextManager cannot be cast to org.jbpm.persistence.ProcessPersistenceContextManager
          at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:32)
          at org.jbpm.process.instance.AbstractProcessInstanceFactory.createProcessInstance(AbstractProcessInstanceFactory.java:36)
          at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:168)
          at org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(ProcessRuntimeImpl.java:140)
          at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:121)
          at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1095)
          at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:306)
          at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:119)
          at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:38)
          at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:292)
          at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:222)
--------------------------------------------------------------

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

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/20111025/68fc8f44/attachment.html 


More information about the jboss-user mailing list