当IBM是8.5服务器启动IBM是8.5时,无法为org.jbpm.persistence.jpa持久性单元创建容器实体管理器工厂

时间:2015-08-19 07:16:32

标签: java spring hibernate jpa jbpm

我们使用SpringMVC + JBPM 6.2+ SpringJPA创建了应用程序。在IBM Was 8.5上部署应用程序之后,我们启动了WAS服务器,我们得到了下面的堆栈跟踪。

[8/17/15 3:30:51:935 EDT] 0000006b FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/middleware/jbpm2/jbpm2_Runtime/profiles/jbpm2Cell/jbpm2Profile/logs/ffdc/pawRschServer_13ef3ae4_15.08.17_03.30.51.7772564160808271804648.txt com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory 759
[8/17/15 3:30:51:936 EDT] 0000006b 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
[8/17/15 3:30:52:435 EDT] 0000006b FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/middleware/jbpm2/jbpm2_Runtime/profiles/jbpm2Cell/jbpm2Profile/logs/ffdc/pawRschServer_13ef3ae4_15.08.17_03.30.52.3302481618060693532725.txt com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory 773
[8/17/15 3:30:52:435 EDT] 0000006b 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: java.lang.NullPointerException
        at org.hibernate.engine.jdbc.internal.TypeInfoExtracter.extractTypeInfo(TypeInfoExtracter.java:85)
        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:144)
        at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156)
        at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1827)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1785)
        at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:900)

下面是persistence.xml和springconfig文件的代码片段。

弹簧-config.xml中

<!-- JPA / Hibernate Configuration -->

<bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" />
    <property name="persistenceUnitName" value="org.jbpm.persistence.jpa" />
    <property name="jpaPropertyMap">
        <map>
            <entry key="hibernate.connection.datasource" value="java:comp/env/jdbc/jbpmDS" />
            <entry key="hibernate.dialect" value="org.hibernate.dialect.Oracle8iDialect" />
            <entry key="hibernate.show_sql" value="false" />
            <entry key="hibernate.order_updates" value="true" />
            <entry key="hibernate.order_inserts" value="true" />
            <entry key="hibernate.use_sql_comments" value="true" />
            <entry key="hibernate.format_sql" value="true" />
            <entry key="hibernate.generate_statistics" value="false" />
            <entry key="use_sql_comments" value="true" />
            <entry key="hibernate.current_session_context_class" value="jta" />
            <entry key="hibernate.transaction.jta.platform" value="${hibernate.transaction.jta.platform}" />
            <entry key="hibernate.transaction.manager_lookup_class" value="${hibernate.transaction.manager_lookup_class}" />
        </map>
    </property>
</bean>


<!-- Transaction Management Configuration -->
<tx:annotation-driven />
<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/jbpmDS"
    expected-type="javax.sql.DataSource" />


<bean id="BitronixTransactionManager" factory-method="getTransactionManager"
    class="bitronix.tm.TransactionManagerServices" destroy-method="shutdown" />

<bean id="transactionManager"
    class="org.springframework.transaction.jta.JtaTransactionManager"
    autowire="constructor" depends-on="dataSource">
    <property name="transactionManager" ref="BitronixTransactionManager" />
</bean>

的persistence.xml

<persistence 
  version="2.0"
  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"
  xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://java.sun.com/xml/ns/persistence">

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


    <mapping-file>META-INF/JBPMorm.xml</mapping-file>
    <mapping-file>META-INF/Taskorm.xml</mapping-file>
    <mapping-file>META-INF/TaskAuditorm.xml</mapping-file>
    <mapping-file>META-INF/MediaReqDetailsorm.xml</mapping-file>

    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
    <class>org.drools.persistence.info.SessionInfo</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.persistence.correlation.CorrelationKeyInfo</class>
    <class>org.jbpm.persistence.correlation.CorrelationPropertyInfo</class>

    <!-- manager -->
    <class>org.jbpm.runtime.manager.impl.jpa.ContextMappingInfo</class>

    <class>org.jbpm.services.task.impl.model.AttachmentImpl</class>
    <class>org.jbpm.services.task.impl.model.ContentImpl</class>
    <class>org.jbpm.services.task.impl.model.BooleanExpressionImpl</class>
    <class>org.jbpm.services.task.impl.model.CommentImpl</class>
    <class>org.jbpm.services.task.impl.model.DeadlineImpl</class>
    <class>org.jbpm.services.task.impl.model.DelegationImpl</class>
    <class>org.jbpm.services.task.impl.model.EscalationImpl</class>
    <class>org.jbpm.services.task.impl.model.GroupImpl</class>
    <class>org.jbpm.services.task.impl.model.I18NTextImpl</class>
    <class>org.jbpm.services.task.impl.model.NotificationImpl</class>
    <class>org.jbpm.services.task.impl.model.EmailNotificationImpl</class>
    <class>org.jbpm.services.task.impl.model.EmailNotificationHeaderImpl</class>
    <class>org.jbpm.services.task.impl.model.PeopleAssignmentsImpl</class>
    <class>org.jbpm.services.task.impl.model.ReassignmentImpl</class>

    <class>org.jbpm.services.task.impl.model.TaskImpl</class>
    <class>org.jbpm.services.task.impl.model.TaskDataImpl</class>
    <class>org.jbpm.services.task.impl.model.UserImpl</class>


    <!--BAM for task service -->
    <class>org.jbpm.services.task.audit.impl.model.BAMTaskSummaryImpl</class>

    <!-- Event Classes -->
    <class>org.jbpm.services.task.audit.impl.model.TaskEventImpl</class>

    <!-- Task Audit Classes --> 
    <class>org.jbpm.services.task.audit.impl.model.AuditTaskImpl</class>

    <properties>
        <property name="hibernate.max_fetch_depth" value="3"/>
        <property name="hibernate.hbm2ddl.auto" value="validate" />
        <property name="hibernate.show_sql" value="true" />
        <property name="hibernate.connection.autocommit" value="true" />
         <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->      
        <property name="hibernate.id.new_generator_mappings" value="false" />       
        <property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />       
    </properties>        
  </persistence-unit>

</persistence>

FFDC记录

[8/19/15 3:46:35:899 EDT]     FFDC Exception:java.lang.NullPointerException SourceId:com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory ProbeId:773 Reporter:com.ibm.ws.jpa.management.JPAPUnitInfo@2b547d97
java.lang.NullPointerException
    at org.hibernate.engine.jdbc.internal.TypeInfoExtracter.extractTypeInfo(TypeInfoExtracter.java:85)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:144)
    at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156)
    at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1827)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1785)
    at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:900)
    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:76)
    at com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory(JPAPUnitInfo.java:1584)
    at com.ibm.ws.jpa.management.JPAPUnitInfo.createEntityManagerFactory(JPAPUnitInfo.java:1406)
    at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:246)
    at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:119)
    at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:167)
    at com.ibm.ws.jpa.management.AbstractJPAComponent.startingModule(AbstractJPAComponent.java:451)
    at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:729)
    at com.ibm.ws.jpa.management.JPAComponentImpl.adjust(JPAComponentImpl.java:549)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.adjust(ApplicationMgrImpl.java:1069)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectAdjust(DeployedApplicationImpl.java:1394)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:627)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2182)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
    at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)

当我们启动WAS服务器时,会提到堆栈跟踪。正如单独的线程(NullPointerException: Unable to create the container entity manager factory for the org.jbpm.persistence.jpa persistence unit)中所提到的,我们已经在 persistence.xml 中将属性hibernate.temp.use_jdbc_metadata_defaults设置为false。任何人都可以告诉我这个问题是什么以及为什么这个问题会出现在IBM WAS上?

0 个答案:

没有答案