title: Issue in deploying JBPM 5.4 console server war on Websphere application server with JPA2 feature pack to use oracle database
body: <p>Facing issue in deploying JBPM 5.4 console server war to use oracle database. Please find below the stacktrace. </p>
  
  <pre><code>  [10/31/13 19:17:01:295 IST] 00000009 JPAPUnitInfo  E   CWWJP0015E: An error occurred in the org.hibernate.ejb.HibernatePersistence persistence provider when it attempted to create the container entity manager factory for the org.jbpm.persistence.jpa persistence unit. The following error occurred: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory
      [10/31/13 19:17:01:296 IST] 00000009 JPAPUnitInfo  E   CWWJP0009E: The server cannot create an EntityManagerFactory factory for the org.jbpm.persistence.jpa persistent unit from the org.hibernate.ejb.HibernatePersistence provider in file:/C:/Data/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/USMUMRANANDIGA1Node01Cell/jbpm-gwt-console-server-5_4_0_Final-EE6_A_war.ear/jbpm-gwt-console-server-5.4.0.Final-EE6_A.war/WEB-INF/classes/ module.
      [10/31/13 19:17:01:295 IST] 00000009 FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Data\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\server1_33d433d4_13.10.31_19.17.01.2236946324497770174513.txt com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory 759
      [10/31/13 19:17:02:118 IST] 00000009 SystemOut     O 1    31/10 19:17:02,110[server.startup : 1] ERROR tool.hbm2ddl.SchemaUpdate.execute  - could not get database metadata
      java.sql.SQLException: Unsupported use of GenericConnection.  A GenericConnection is provided during application start when creating an EntityManagerFactory for a persistence unit which has configured one of its datasource to be in the component naming context; java:comp/env. During application start, the component naming context will not exist, and the correct datasource cannot be determined. When the persistence unit is used, the proper datasource and connection will be obtained and used.
          at com.ibm.ws.jpa.management.GenericConnection.unsupportedUseSQLException(GenericConnection.java:584)
          at com.ibm.ws.jpa.management.GenericConnection.createStatement(GenericConnection.java:151)
          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:150)
          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.&lt;init&gt;(DatabaseMetadata.java:69)
          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.&lt;init&gt;(DatabaseMetadata.java:62)
          at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:170)
          at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:356)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
          at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
          at com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory(JPAPUnitInfo.java:1602)
          at com.ibm.ws.jpa.management.JPAPUnitInfo.createEntityManagerFactory(JPAPUnitInfo.java:1352)
          at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:243)
          at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:117)
          at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:169)
          at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:878)
          at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:722)
          at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1080)
          at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1302)
          at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:222)
          at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:608)
          at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:944)
          at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:741)
          at com.ibm.ws.runtime.component.ApplicationMgrImpl$3.run(ApplicationMgrImpl.java:2056)
          at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5395)
          at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5483)
          at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
          at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2061)
          at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:389)
          at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
          at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:332)
          at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:117)
          at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:899)
          at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:496)
          at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1656)
      [10/31/13 19:17:02:119 IST] 00000009 SystemOut     O 10   31/10 19:17:02,119[server.startup : 1] ERROR tool.hbm2ddl.SchemaUpdate.execute  - could not complete schema update
      java.sql.SQLException: Unsupported use of GenericConnection.  A GenericConnection is provided during application start when creating an EntityManagerFactory for a persistence unit which has configured one of its datasource to be in the component naming context; java:comp/env. During application start, the component naming context will not exist, and the correct datasource cannot be determined. When the persistence unit is used, the proper datasource and connection will be obtained and used.
          at com.ibm.ws.jpa.management.GenericConnection.unsupportedUseSQLException(GenericConnection.java:584)
          at com.ibm.ws.jpa.management.GenericConnection.createStatement(GenericConnection.java:151)
          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:150)
          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.&lt;init&gt;(DatabaseMetadata.java:69)
          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.&lt;init&gt;(DatabaseMetadata.java:62)
          at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:170)
          at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:356)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
          at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
          at com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory(JPAPUnitInfo.java:1602)
          at com.ibm.ws.jpa.management.JPAPUnitInfo.createEntityManagerFactory(JPAPUnitInfo.java:1352)
          at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:243)
          at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:117)
          at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:169)
          at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:878)
          at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:722)
          at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1080)
          at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1302)
          at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:222)
          at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:608)
          at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:944)
          at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:741)
          at com.ibm.ws.runtime.component.ApplicationMgrImpl$3.run(ApplicationMgrImpl.java:2056)
          at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5395)
          at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5483)
          at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
          at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2061)
          at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:389)
          at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
          at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:332)
          at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:117)
          at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:899)
          at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:496)
          at com.ibm.ws.util.ThreadPool$Worker.r
  </code></pre>
  
  <p>un(ThreadPool.java:1656)</p>
  
  <p>Please find below the persistence.xml entry :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0"
      xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"&gt;
  
  
          &lt;persistence-unit name="org.jbpm.persistence.jpa"
              transaction-type="JTA"&gt;
              &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
              &lt;jta-data-source&gt;java:comp/env/jdbc/jbpmDS&lt;/jta-data-source&gt;
  
              &lt;class&gt;org.drools.persistence.info.SessionInfo&lt;/class&gt;
              &lt;class&gt;org.jbpm.persistence.processinstance.ProcessInstanceInfo&lt;/class&gt;
              &lt;class&gt;org.drools.persistence.info.WorkItemInfo&lt;/class&gt;
  
              &lt;class&gt;org.jbpm.process.audit.ProcessInstanceLog&lt;/class&gt;
              &lt;class&gt;org.jbpm.process.audit.NodeInstanceLog&lt;/class&gt;
              &lt;class&gt;org.jbpm.process.audit.VariableInstanceLog&lt;/class&gt;
  
              &lt;properties&gt;
  
                              &lt;property name="hibernate.max_fetch_depth" value="3" /&gt;
  
                  &lt;property name="hibernate.show_sql" value="true" /&gt;
  
  
  
                  &lt;property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" /&gt;
  
  
  
  
              &lt;/properties&gt;
  
          &lt;/persistence-unit&gt;
      &lt;/persistence&gt;
  </code></pre>
  
  <p>jbpmDS is configured on WAS 7. Friends any ideas about the root cause?</p>
  
  <p>I have configured my persistence.xml in the following way to resolve the issue :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0"
      xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"&gt;
  
  
          &lt;persistence-unit transaction-type="RESOURCE_LOCAL"
              name="org.jbpm.persistence.jpa"&gt;
              &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
  
              &lt;mapping-file&gt;META-INF/JBPMorm-JPA2.xml&lt;/mapping-file&gt;
              &lt;mapping-file&gt;META-INF/ProcessInstanceInfoMapping-JPA2.xml&lt;/mapping-file&gt;
  
  
              &lt;class&gt;org.drools.persistence.info.SessionInfo&lt;/class&gt;
              &lt;class&gt;org.jbpm.persistence.processinstance.ProcessInstanceInfo&lt;/class&gt;
              &lt;class&gt;org.drools.persistence.info.WorkItemInfo&lt;/class&gt;
              &lt;class&gt;org.jbpm.process.audit.ProcessInstanceLog&lt;/class&gt;
              &lt;class&gt;org.jbpm.process.audit.NodeInstanceLog&lt;/class&gt;
              &lt;class&gt;org.jbpm.process.audit.VariableInstanceLog&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Attachment&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Content&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.BooleanExpression&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Comment&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Deadline&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Comment&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Deadline&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Delegation&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Escalation&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Group&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.I18NText&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Notification&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.EmailNotification&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.EmailNotificationHeader&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.PeopleAssignments&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Reassignment&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Status&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.Task&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.TaskData&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.SubTasksStrategy&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.OnParentAbortAllSubTasksEndStrategy&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.OnAllSubTasksEndParentEndStrategy&lt;/class&gt;
              &lt;class&gt;org.jbpm.task.User&lt;/class&gt;
  
              &lt;properties&gt;
                  &lt;property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" /&gt;
                  &lt;property name="hibernate.generateDdl" value="true" /&gt;
                  &lt;property name="hibernate.showSql" value="true" /&gt;
                  &lt;property name="hibernate.max_fetch_depth" value="3" /&gt;
                  &lt;property name="hibernate.hbm2ddl.auto" value="update" /&gt;
                  &lt;property name="hibernate.archive.autodetection" value="class" /&gt;
                  &lt;property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" /&gt;
                  &lt;property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:xe" /&gt;
                  &lt;property name="hibernate.connection.username" value="arunabh" /&gt;
                  &lt;property name="hibernate.connection.password" value="arunabh" /&gt;
              &lt;/properties&gt;
          &lt;/persistence-unit&gt;
      &lt;/persistence&gt;
  </code></pre>