NullPointerException:无法为org.jbpm.persistence.jpa持久性单元创建容器实体管理器工厂

时间:2013-07-17 15:44:48

标签: xml hibernate ejb jbpm

我附加了persistence.xml和ormTasks.xml的前几行

的persistence.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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_1_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="cms" transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/MarkaDS</jta-data-source>
        <non-jta-data-source>jdbc/TestServiceDS</non-jta-data-source>
        <mapping-file>META-INF/JBPMorm-JPA2.xml</mapping-file>
        <mapping-file>META-INF/ormTasks.xml</mapping-file>

OrmTasks.xml

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="1.0" xmlns="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/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">

日志

 [7/17/13 11:34:46:720 EDT] 00000046 SystemOut     O 4127 17/07 11:34:46,719[server.startup : 2] ERROR util.xml.ErrorLogger.parsingXmlError  - HHH00196:Error parsing XML (5) : cvc-complex-type.3.1: Value '1.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '2.0'.
    [7/17/13 11:34:46:738 EDT] 00000046 SystemOut     O 4146 17/07 11:34:46,738[server.startup : 2] ERROR util.xml.ErrorLogger.parsingXmlError  - HHH00196:Error parsing XML (5) : cvc-complex-type.3.1: Value '1.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '2.0'.
    [7/17/13 11:34:46:981 EDT] 00000046 FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\server1_24ab539c_13.07.17_11.34.46.8495384170661565376218.txt com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory 773
    [7/17/13 11:34:46:982 EDT] 00000046 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:140)
        at org.hibernate.service.internal.BasicServiceRegistryImpl.configureService(BasicServiceRegistryImpl.java:80)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:145)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:118)
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:70)
        at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2253)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2249)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1720)
        at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:899)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:884)
        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
        at com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory(JPAPUnitInfo.java:1568)
        at com.ibm.ws.jpa.management.JPAPUnitInfo.createEntityManagerFactory(JPAPUnitInfo.java:1393)
        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:435)
        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:1067)
        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:772)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2175)
        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:496)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1815)

1 个答案:

答案 0 :(得分:3)

我可以通过将hibernate.temp.use_jdbc_metadata_defaults设置为false来修复此错误。我不确定你发布的摘录你会在哪里设置它。对我来说,它是持久性单元的Spring配置。