休眠 OGM Neo4j (5.0) Wildfly 10 错误。提供者 org.hibernate.ogm.service.impl.OgmIntegrator 不是子类型
Posted
技术标签:
【中文标题】休眠 OGM Neo4j (5.0) Wildfly 10 错误。提供者 org.hibernate.ogm.service.impl.OgmIntegrator 不是子类型【英文标题】:Hibernate OGM Neo4j (5.0 ) Wildfly 10 Error. Provider org.hibernate.ogm.service.impl.OgmIntegrator not a subtype 【发布时间】:2016-07-07 01:29:53 【问题描述】:我在部署 ear 时遇到此错误。
org.jboss.msc.service.StartException in service jboss.persistenceunit."test.ear/server.war#graphdb": java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.ogm.service.impl.OgmIntegrator not a subtype
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.ogm.service.impl.OgmIntegrator not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:324)
at org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:40)
at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:213)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:288)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:161)
at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:34)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:165)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:160)
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135)
at org.hibernate.ogm.jpa.HibernateOgmPersistence.createContainerEntityManagerFactory(HibernateOgmPersistence.java:96)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:318)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$1100(PersistenceUnitServiceImpl.java:67)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167)
... 7 more
而我的持久化 xml 是
<persistence-unit name="graphdb" transaction-type="JTA">
<!-- Use Hibernate OGM provider: configuration will be transparent -->
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<class>com.healthpray.persistence.entities.User</class>
<properties>
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
<property name="hibernate.ogm.datastore.provider" value="neo4j_embedded" />
<property name="hibernate.ogm.neo4j.database_path" value="/home/manju/testdb" />
</properties>
</persistence-unit>
请问有什么问题吗? .我也尝试删除 JTA 提供程序。
野蝇 - 10.0 JPA -2.1 爪哇 - 8 休眠 - 5.0.0.Beta1
【问题讨论】:
【参考方案1】:由于 Wildfly 试图加载不同版本的休眠,它无法正常工作。所以二进制冲突。
我在 standalone.xml
中禁用了 JPA 子系统。现在它工作正常。
【讨论】:
以上是关于休眠 OGM Neo4j (5.0) Wildfly 10 错误。提供者 org.hibernate.ogm.service.impl.OgmIntegrator 不是子类型的主要内容,如果未能解决你的问题,请参考以下文章
使用 MongoDB 休眠 OGM - 创建 EntityManagerFactory 时出现 ClassNotFoundException
Neo4j - 将 CQL 返回结果映射到 List<POJO>