<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
How to create a knowledgeSession (Websphare 6.1)
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/sandeep_jbpm5">sandeep kumar</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/637917#637917">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi </p><p> How to create a knowledgesession in websphare6.1. I am using the following code but it throws exception</p><p>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();</p><p> kbuilder.add(ResourceFactory.newClassPathResource("xyz-process.bpmn"), ResourceType.BPMN2);</p><p> KnowledgeBase kbase = kbuilder.newKnowledgeBase(); EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );</p><p> Environment env = KnowledgeBaseFactory.newEnvironment();</p><p> env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> Properties properties = new Properties();</p><p> properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");</p><p> properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");</p><p> TransactionManager tm =</p><p> new WebSphereTransactionManagerLookup().getTransactionManager(properties);</p><p> env.set( EnvironmentName.TRANSACTION_MANAGER, tm );</p><p> KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);</p><p> JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><persistence-unit name="org.jbpm.persistence.jpa"</p><p> transaction-type="JTA"></p><p> <provider>org.hibernate.ejb.HibernatePersistence</provider></p><p> <jta-data-source>java:comp/env/jdbc/sandeep</jta-data-source></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>                <!--<non-jta-data-source>java:comp/env/jdbc/sandeep1</non-jta-data-source></p><p> --><mapping-file>META-INF/jpa-orm.xml</mapping-file></p><p> <class>org.drools.persistence.info.SessionInfo</class></p><p> <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class></p><p> <class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class></p><p> <class>org.drools.persistence.info.WorkItemInfo</class></p><p> <class>org.jbpm.process.audit.ProcessInstanceLog</class></p><p> <class>org.jbpm.process.audit.VariableInstanceLog</class></p><p> <!--<class>org.jbpm.process.audit.NodeInstanceLog</class>      --></p><p> <properties></p><p> <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" /></p><p> <property name="hibernate.connection.autocommit" value="false" /></p><p> <property name="hibernate.max_fetch_depth" value="3" /></p><p>                        <property name="hibernate.hbm2ddl.auto" value="create" /></p><p> <property name="hibernate.show_sql" value="true" /></p><p> <property name="hibernate.transaction.manager_lookup_class"</p><p> value="org.hibernate.transaction.WebSphereTransactionManagerLookup" /></p><p>   <!--<property name="hibernate.transaction.manager_lookup_class"</p><p> value="org.hibernate.transaction.JBossTransactionManagerLookup" /></p><p> --><!--<property name="hibernate.transaction.manager_lookup_class"</p><p> value="org.hibernate.transaction.BTMTransactionManagerLookup"/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> --></properties></p><p> </persistence-unit></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Exception block</p><p>com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\IBM\WebSphere\AppServer1\profiles\AppSrv02\logs\ffdc\server1_00000016_11.11.23_05.59.20_0.txt</p><p>[11/23/11 5:59:20:572 EST] 00000016 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\IBM\WebSphere\AppServer1\profiles\AppSrv02\logs\ffdc\server1_00000016_11.11.23_05.59.20_0.txt</p><p>[11/23/11 5:59:20:572 EST] 00000016 ServletWrappe E   SRVE0100E: Did not realize  init() exception thrown by servlet TaskProcessServlet: java.lang.RuntimeException: error while creating session</p><p>    at com.sample.processserver.TaskProcessServlet.init(TaskProcessServlet.java:52)</p><p>    at javax.servlet.GenericServlet.init(GenericServlet.java:256)</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:191)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:326)</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1143)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:159)</p><p>    at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:790)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:470)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:307)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:334)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:90)</p><p>    at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:665)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:618)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:395)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1302)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1165)</p><p>    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:587)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:832)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:951)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2129)</p><p>    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)</p><p>    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)</p><p>Caused by: java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:130)</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)</p><p>    at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)</p><p>    at com.sample.processserver.JbpmAPIUtil.createSession(JbpmAPIUtil.java:279)</p><p>    at com.sample.processserver.JbpmAPIUtil.getSession(JbpmAPIUtil.java:245)</p><p>    at com.sample.processserver.TaskProcessServlet.init(TaskProcessServlet.java:38)</p><p>    ... 24 more</p><p>Caused by: java.lang.reflect.InvocationTargetException</p><p>    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</p><p>    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)</p><p>    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)</p><p>    at java.lang.reflect.Constructor.newInstance(Constructor.java:522)</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)</p><p>    ... 29 more</p><p>Caused by: java.lang.ClassCastException: [Ljava.lang.Object; incompatible with [Ljava.util.Map$Entry;</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writePropagationContexts(OutputMarshaller.java:716)</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writeFactHandles(OutputMarshaller.java:280)</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writeSession(OutputMarshaller.java:107)</p><p>    at org.drools.marshalling.impl.DefaultMarshaller.marshall(DefaultMarshaller.java:136)</p><p>    at org.drools.persistence.SessionMarshallingHelper.getSnapshot(SessionMarshallingHelper.java:72)</p><p>    at org.drools.persistence.info.SessionInfo.update(SessionInfo.java:81)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)</p><p>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</p><p>    at java.lang.reflect.Method.invoke(Method.java:618)</p><p>    at org.hibernate.ejb.event.BeanCallback.invoke(BeanCallback.java:23)</p><p>    at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:80)</p><p>    at org.hibernate.ejb.event.EntityCallbackHandler.preCreate(EntityCallbackHandler.java:49)</p><p>    at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:48)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)</p><p>    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)</p><p>    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)</p><p>    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)</p><p>    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)</p><p>    at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:17)</p><p>    at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:125)</p><p>    ... 34 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[11/23/11 5:59:20:587 EST] 00000016 ServletWrappe E   Deregister the mbean because of uncaught init() exception thrown by servlet TaskProcessServlet: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception thrown by servlet</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:243)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:326)</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1143)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:159)</p><p>    at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:790)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:470)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:307)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:334)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:90)</p><p>    at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:665)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:618)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:395)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1302)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1165)</p><p>    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:587)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:832)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:951)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2129)</p><p>    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)</p><p>    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)</p><p>---- Begin backtrace for Nested Throwables</p><p>java.lang.RuntimeException: error while creating session</p><p>    at com.sample.processserver.TaskProcessServlet.init(TaskProcessServlet.java:52)</p><p>    at javax.servlet.GenericServlet.init(GenericServlet.java:256)</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:191)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:326)</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1143)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:159)</p><p>    at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:790)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:470)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:307)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:334)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:90)</p><p>    at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:665)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:618)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:395)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1302)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1165)</p><p>    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:587)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:832)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:951)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2129)</p><p>    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)</p><p>    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)</p><p>Caused by: java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:130)</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)</p><p>    at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)</p><p>    at com.sample.processserver.JbpmAPIUtil.createSession(JbpmAPIUtil.java:279)</p><p>    at com.sample.processserver.JbpmAPIUtil.getSession(JbpmAPIUtil.java:245)</p><p>    at com.sample.processserver.TaskProcessServlet.init(TaskProcessServlet.java:38)</p><p>    ... 24 more</p><p>Caused by: java.lang.reflect.InvocationTargetException</p><p>    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</p><p>    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)</p><p>    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)</p><p>    at java.lang.reflect.Constructor.newInstance(Constructor.java:522)</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)</p><p>    ... 29 more</p><p>Caused by: java.lang.ClassCastException: [Ljava.lang.Object; incompatible with [Ljava.util.Map$Entry;</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writePropagationContexts(OutputMarshaller.java:716)</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writeFactHandles(OutputMarshaller.java:280)</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writeSession(OutputMarshaller.java:107)</p><p>    at org.drools.marshalling.impl.DefaultMarshaller.marshall(DefaultMarshaller.java:136)</p><p>    at org.drools.persistence.SessionMarshallingHelper.getSnapshot(SessionMarshallingHelper.java:72)</p><p>    at org.drools.persistence.info.SessionInfo.update(SessionInfo.java:81)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)</p><p>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</p><p>    at java.lang.reflect.Method.invoke(Method.java:618)</p><p>    at org.hibernate.ejb.event.BeanCallback.invoke(BeanCallback.java:23)</p><p>    at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:80)</p><p>    at org.hibernate.ejb.event.EntityCallbackHandler.preCreate(EntityCallbackHandler.java:49)</p><p>    at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:48)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)</p><p>    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)</p><p>    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)</p><p>    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)</p><p>    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)</p><p>    at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:17)</p><p>    at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:125)</p><p>    ... 34 more</p><p>, </p><p>[11/23/11 5:59:20:587 EST] 00000016 WebExtensionP E   Error occured while preparing the servlet for initialization. </p><p>javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception thrown by servlet</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:243)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:326)</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1143)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:159)</p><p>    at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:790)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:470)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:307)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:334)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:90)</p><p>    at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:665)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:618)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:395)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1302)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1165)</p><p>    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:587)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:832)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:951)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2129)</p><p>    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)</p><p>    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)</p><p>---- Begin backtrace for Nested Throwables</p><p>java.lang.RuntimeException: error while creating session</p><p>    at com.sample.processserver.TaskProcessServlet.init(TaskProcessServlet.java:52)</p><p>    at javax.servlet.GenericServlet.init(GenericServlet.java:256)</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:191)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:326)</p><p>    at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1143)</p><p>    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:159)</p><p>    at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:790)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:470)</p><p>    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:307)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:334)</p><p>    at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:90)</p><p>    at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:665)</p><p>    at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:618)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:395)</p><p>    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1302)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1165)</p><p>    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:587)</p><p>    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:832)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:951)</p><p>    at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2129)</p><p>    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342)</p><p>    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)</p><p>Caused by: java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:130)</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)</p><p>    at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)</p><p>    at com.sample.processserver.JbpmAPIUtil.createSession(JbpmAPIUtil.java:279)</p><p>    at com.sample.processserver.JbpmAPIUtil.getSession(JbpmAPIUtil.java:245)</p><p>    at com.sample.processserver.TaskProcessServlet.init(TaskProcessServlet.java:38)</p><p>    ... 24 more</p><p>Caused by: java.lang.reflect.InvocationTargetException</p><p>    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</p><p>    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)</p><p>    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)</p><p>    at java.lang.reflect.Constructor.newInstance(Constructor.java:522)</p><p>    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)</p><p>    ... 29 more</p><p>Caused by: java.lang.ClassCastException: [Ljava.lang.Object; incompatible with [Ljava.util.Map$Entry;</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writePropagationContexts(OutputMarshaller.java:716)</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writeFactHandles(OutputMarshaller.java:280)</p><p>    at org.drools.marshalling.impl.OutputMarshaller.writeSession(OutputMarshaller.java:107)</p><p>    at org.drools.marshalling.impl.DefaultMarshaller.marshall(DefaultMarshaller.java:136)</p><p>    at org.drools.persistence.SessionMarshallingHelper.getSnapshot(SessionMarshallingHelper.java:72)</p><p>    at org.drools.persistence.info.SessionInfo.update(SessionInfo.java:81)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)</p><p>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</p><p>    at java.lang.reflect.Method.invoke(Method.java:618)</p><p>    at org.hibernate.ejb.event.BeanCallback.invoke(BeanCallback.java:23)</p><p>    at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:80)</p><p>    at org.hibernate.ejb.event.EntityCallbackHandler.preCreate(EntityCallbackHandler.java:49)</p><p>    at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:48)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)</p><p>    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)</p><p>    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)</p><p>    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)</p><p>    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)</p><p>    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)</p><p>    at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:17)</p><p>    at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:125)</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/637917#637917">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>