0

在部署 JBPM 5.4 控制台服务器战争以使用 oracle 数据库时面临问题。请在堆栈跟踪下方找到。

  [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.<init>(DatabaseMetadata.java:69)
        at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:62)
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:170)
        at org.hibernate.impl.SessionFactoryImpl.<init>(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.<init>(DatabaseMetadata.java:69)
        at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:62)
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:170)
        at org.hibernate.impl.SessionFactoryImpl.<init>(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

联合国(线程池.java:1656)

请在 persistence.xml 条目下方找到:

<?xml version="1.0" encoding="UTF-8"?>
<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">


        <persistence-unit name="org.jbpm.persistence.jpa"
            transaction-type="JTA">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:comp/env/jdbc/jbpmDS</jta-data-source>

            <class>org.drools.persistence.info.SessionInfo</class>
            <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
            <class>org.drools.persistence.info.WorkItemInfo</class>

            <class>org.jbpm.process.audit.ProcessInstanceLog</class>
            <class>org.jbpm.process.audit.NodeInstanceLog</class>
            <class>org.jbpm.process.audit.VariableInstanceLog</class>

            <properties>

                            <property name="hibernate.max_fetch_depth" value="3" />

                <property name="hibernate.show_sql" value="true" />



                <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />




            </properties>

        </persistence-unit>
    </persistence>

jbpmDS 是在 WAS 7 上配置的。朋友对根本原因有什么想法吗?

我已通过以下方式配置了我的 persistence.xml 来解决此问题:

<?xml version="1.0" encoding="UTF-8"?>
<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">


        <persistence-unit transaction-type="RESOURCE_LOCAL"
            name="org.jbpm.persistence.jpa">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>

            <mapping-file>META-INF/JBPMorm-JPA2.xml</mapping-file>
            <mapping-file>META-INF/ProcessInstanceInfoMapping-JPA2.xml</mapping-file>


            <class>org.drools.persistence.info.SessionInfo</class>
            <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
            <class>org.drools.persistence.info.WorkItemInfo</class>
            <class>org.jbpm.process.audit.ProcessInstanceLog</class>
            <class>org.jbpm.process.audit.NodeInstanceLog</class>
            <class>org.jbpm.process.audit.VariableInstanceLog</class>
            <class>org.jbpm.task.Attachment</class>
            <class>org.jbpm.task.Content</class>
            <class>org.jbpm.task.BooleanExpression</class>
            <class>org.jbpm.task.Comment</class>
            <class>org.jbpm.task.Deadline</class>
            <class>org.jbpm.task.Comment</class>
            <class>org.jbpm.task.Deadline</class>
            <class>org.jbpm.task.Delegation</class>
            <class>org.jbpm.task.Escalation</class>
            <class>org.jbpm.task.Group</class>
            <class>org.jbpm.task.I18NText</class>
            <class>org.jbpm.task.Notification</class>
            <class>org.jbpm.task.EmailNotification</class>
            <class>org.jbpm.task.EmailNotificationHeader</class>
            <class>org.jbpm.task.PeopleAssignments</class>
            <class>org.jbpm.task.Reassignment</class>
            <class>org.jbpm.task.Status</class>
            <class>org.jbpm.task.Task</class>
            <class>org.jbpm.task.TaskData</class>
            <class>org.jbpm.task.SubTasksStrategy</class>
            <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
            <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
            <class>org.jbpm.task.User</class>

            <properties>
                <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
                <property name="hibernate.generateDdl" value="true" />
                <property name="hibernate.showSql" value="true" />
                <property name="hibernate.max_fetch_depth" value="3" />
                <property name="hibernate.hbm2ddl.auto" value="update" />
                <property name="hibernate.archive.autodetection" value="class" />
                <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
                <property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:xe" />
                <property name="hibernate.connection.username" value="arunabh" />
                <property name="hibernate.connection.password" value="arunabh" />
            </properties>
        </persistence-unit>
    </persistence>
4

3 回答 3

0

正如这篇文章所说,它似乎与数据源的名称有关。先尝试一下,看看是否收到第二个错误: https ://www.ibm.com/developerworks/community/forums/html/topic?id=77777777- 0000-0000-0000-000014210826

于 2013-10-31T21:13:22.200 回答
0

<jta-data-source>java:comp/...</jta-data-source>不适用于容器管理的 Hibernate JPA。WebSphere Application Server 需要在应用程序中执行几乎所有其他操作之前调用 createContainerEntityManagerFactory,因为该调用可能会注册一个需要修改实体字节码的 ClassFileTransformer。

您的选择是:

  1. 从服务器名称空间(例如, )中删除<jta-data-source>java:comp/...</jta-data-source>并使用 JNDI 名称。<jta-data-source>jdbc/myds</jta-data-source>

  2. 为应用程序禁用容器管理的 JPA,如APAR PM26361中所述。(此 APAR 描述了在应用程序启动期间调用 createContainerEntityManagerFactory 引起的性能问题,但该属性也可用于避免此问题。)当然,禁用容器管理的 JPA 意味着您不能再使用@PersistenceUnit/@PersistenceContext注释或<persistence-unit-ref>/ <persistence-context-ref>

于 2013-11-02T15:25:01.337 回答
0

我同意@bkail 的观点。
我在 WAS 7 上运行时遇到了类似的问题。在答案中的第一个选项之后解决了它。不推荐使用第二个选项,因为客户端使用同一台服务器来托管多个应用程序。
除此之外,我还jbpm-test-5.4.0.Final.jar从WAR 项目中EAR -> Deployment Assembly删除了 jar 文件。WEB-INF/lib否则,仅当 Websphere 检测到 jar 中的数据源时,它才与第一个选项一起使用。

于 2014-01-10T15:04:57.070 回答