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]
_______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user
