<!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="https://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;">
jBpm 5.2 persistence problem - Oracle - Unknown entity: org.drools.persistence.info.SessionInfo
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/whizkid.samrat">Samrat Roy</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/717687#717687">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 , I am setting up jBpm 5.2 with persistence for the first time and facing a LoT of issues. I am using jpm 5.2 with Spring 3.0 and Hibernate 3.5.6 on <span style="text-decoration: underline;">jBoss AS 7</span> server.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>We all know that jBoss AS 7 comes with Hibernate 4 as the default hibernate , but I need to use the Hibernate 3 in my project so I installed hibernate 3 as a module in as7 and that is working as expected . I excluded Hibernate 4 with jboss-deployment-structure.xml and added org.jboss.as.jpa.hibernate:3 as a dependency in manifest.mf [refer <a class="jive-link-external-small" href="http://badr-elhouari.blogspot.in/2011/10/how-to-use-hibernate-3-as-jpa-provider.html">here</a> how I added hibernate:3 as a module in AS7]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>That said , I have configured the entire knowledge base and knowledge session in spring so that I dont have to write code for that - Taking tips from drools - integration module and by using drools-grid-impl jar and drools-spring jar.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Drools-grid jar contains a persistence.xml which used in memory DB [h2] so I modified the xml to use oracle and hibernate 3 instead.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here is my <strong>application context</strong>:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" p:dataSource-ref="datasource"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">     <property name="jpaVendorAdapter"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">         <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" p:database="${jpa.database}" p:showSql="${jpa.showSql}"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">     </property></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">     <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </bean></span></p><p> <span style="font-family: courier new,courier; font-size: 8pt;">   <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <property name="entityManagerFactory" ref="entityManagerFactory" /></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </bean></span></p><p>    </p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <tx:annotation-driven transaction-manager="transactionManager"/></span></p><p>    </p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />  </span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <!-- First: declare JBPM JPA Session with a process definition --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <jbpm:kbase id="kbase"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <jbpm:resources></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">       <jbpm:resource type="BPMN2" source="classpath:LeaveFlow.bpmn" /></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </jbpm:resources></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </jbpm:kbase></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <jbpm:ksession id="ksession" type="stateful" kbase="kbase"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <jbpm:configuration></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      <jbpm:jpa-persistence></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <jbpm:entity-manager-factory ref="entityManagerFactory"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <jbpm:transaction-manager ref="transactionManager"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      </jbpm:jpa-persistence></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </jbpm:configuration></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </jbpm:ksession></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <!-- Declare a TaskServer --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean class="org.jbpm.task.service.TaskService" id="taskService"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg ref="entityManagerFactory"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      <bean class="org.drools.SystemEventListenerFactory" </span><span style="font-family: courier new,courier; font-size: 8pt;">factory-method="getSystemEventListener"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </constructor-arg></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean class="org.jbpm.task.service.mina.MinaTaskServer" id="taskServer"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg ref="taskService"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg><value>${jbpm.task.server.port}</value></constructor-arg></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <!-- And start TaskServer on the configured port --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean class="java.lang.Thread" id="taskServerThread" init-method="start"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg ref="taskServer"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <!-- Declare a TaskClient --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean class="org.jbpm.task.service.mina.MinaTaskClientConnector" </span><span style="font-family: courier new,courier; font-size: 8pt;">id="taskClientConnector"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg value="taskClient"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      <bean class="org.jbpm.task.service.mina.MinaTaskClientHandler"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <constructor-arg></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">          <bean class="org.drools.SystemEventListenerFactory" </span><span style="font-family: courier new,courier; font-size: 8pt;">factory-method="getSystemEventListener"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        </constructor-arg></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      </bean></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </constructor-arg></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean class="org.jbpm.task.service.TaskClient" id="taskClient"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg ref="taskClientConnector"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <!-- Declare a HumanTaskHandler --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean class="org.jbpm.task.service.AsyncTaskServiceWrapper" </span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">id="humanTaskClient"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg ref="taskClient"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <!-- It uses previously created TaskClient --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean class="org.jbpm.process.workitem.wsht.SyncWSHumanTaskHandler" </span><span style="font-family: courier new,courier; font-size: 8pt;">id="humanTaskHandler"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg ref="humanTaskClient"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <constructor-arg ref="ksession"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <!-- Configure its connection to the local server --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean </span><span style="font-family: courier new,courier; font-size: 8pt;">class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" </span><span style="font-family: courier new,courier; font-size: 8pt;">depends-on="humanTaskHandler" id="setConnection"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <property name="targetObject" ref="humanTaskHandler"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <property name="targetMethod" value="setConnection"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <property name="arguments"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      <list></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <value>${jbpm.task.client.address}</value></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <value>${jbpm.task.client.port}</value></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      </list></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </property></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <!-- And connect HumanTaskHandler (implicit TaskClient connection) --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean </span><span style="font-family: courier new,courier; font-size: 8pt;">class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" </span><span style="font-family: courier new,courier; font-size: 8pt;">depends-on="setConnection"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <property name="targetObject" ref="humanTaskHandler"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <property name="targetMethod" value="connect"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <!-- Finnaly, register HumanTaskHandler in the session --></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean factory-bean="ksession" factory-method="getWorkItemManager" </span><span style="font-family: courier new,courier; font-size: 8pt;">id="workItemManager"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  <bean </span><span style="font-family: courier new,courier; font-size: 8pt;">class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <property name="targetObject" ref="workItemManager"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <property name="targetMethod" value="registerWorkItemHandler"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    <property name="arguments"></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      <list></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <value>Human Task</value></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        <ref bean="humanTaskHandler"/></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">      </list></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    </property></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">  </bean></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The Exception I am getting while server startup is :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">20:07:26,443 ERROR [org.drools.persistence.SingleSessionCommandService] (MSC service thread 1-3) Could not commit session: java.lang.IllegalArgumentException:<span style="color: #3366ff;"><strong> Unknown entity: org.drools.persistence.info.SessionInfo</strong></span></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:671) [hibernate-entitymanager-3.5.6-Final.jar:3.5.6-Final]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365) <span style="color: #0000ff;">[org.springframework.orm-3.0.5.RELEASE.jar:]</span></span></p><p><span style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;">    at $Proxy32.persist(Unknown Source)    at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:17) [drools-persistence-jpa-5.3.1.Final.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:152) [drools-persistence-jpa-5.3.1.Final.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_23]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_23]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_23]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_23]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:129) [drools-persistence-jpa-5.3.1.Final.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:67) [drools-persistence-jpa-5.3.1.Final.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122) [knowledge-api-5.3.1.Final.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.container.spring.beans.StatefulKnowledgeSessionBeanFactory.internalAfterPropertiesSet(StatefulKnowledgeSessionBeanFactory.java:85) [drools-spring-5.3.0.Final.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.drools.container.spring.beans.AbstractKnowledgeSessionBeanFactory.afterPropertiesSet(AbstractKnowledgeSessionBeanFactory.java:123) [drools-spring-5.3.0.Final.jar:]</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) [org.springframework.beans-3.0.5.RELEASE.jar:]</span></p><p>   .......</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>This is driving me nuts as I have all the required jars in my classPath. Please help !!!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I am attaching important config files :</p><p>Application Ctxt of my application , MANIFEST.MF of my application , persistence.xml from my application and the persistence.xml which I modified in drools-grid jar</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/717687#717687">going to Community</a></p>
<p style="margin: 0;">Start a new discussion in jBPM at <a href="https://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>