-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: No Persistence provider for EntityManager for Neo4j
PostPosted: Sun Mar 05, 2017 11:27 am 
Newbie

Joined: Fri Mar 03, 2017 1:06 pm
Posts: 3
Any help will be appreciated for this issue

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'emfJpaNeo4j' threw exception; nested exception is javax.persistence.PersistenceException: No Persistence provider for EntityManager named 60Capital-neo4j-ejbPU
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 52 more
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named 60Capital-neo4j-ejbPU
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:61)
at com.dcubedev.config.Neo4jJpaPersistenceContext.emfJpaNeo4j(Neo4jJpaPersistenceContext.java:78)
at com.dcubedev.config.Neo4jJpaPersistenceContext$$EnhancerBySpringCGLIB$$a3247921.CGLIB$emfJpaNeo4j$0(<generated>)
at com.dcubedev.config.Neo4jJpaPersistenceContext$$EnhancerBySpringCGLIB$$a3247921$$FastClassBySpringCGLIB$$f39932a.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
at com.dcubedev.config.Neo4jJpaPersistenceContext$$EnhancerBySpringCGLIB$$a3247921.emfJpaNeo4j(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 53 more

Here is the EntityManagerFactory I am trying to create

@Bean(name="emfJpaNeo4j")
public EntityManagerFactory emfJpaNeo4j() {
Map<String, Object> properties = new HashMap<String, Object>();
// pass the type
properties.put( Neo4jProperties.DATASTORE_PROVIDER, "neo4j_http" );
properties.put( Neo4jProperties.HOST, "localhost:7474" );
//properties.put( Neo4jProperties.DATABASE, "tutorial" );
properties.put( Neo4jProperties.DATABASE_PATH, "C:/neo4j/database/tutorial" );
properties.put( Neo4jProperties.USERNAME, "neo4j" );
properties.put( Neo4jProperties.PASSWORD, "demo2017" );

EntityManagerFactory emf = Persistence.createEntityManagerFactory( "60Capital-neo4j-ejbPU", properties );

return emf;
}

And persistent.xml
mysql works ok

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" 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/ ... ce_2_0.xsd">
<persistence-unit name="60Capital-ejbPU"
transaction-type="RESOURCE_LOCAL">
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/capital60" />
<property name="hibernate.connection.username" value="stephen" />
<property name="hibernate.connection.password" value="demo2016" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
</properties>
</persistence-unit>
<persistence-unit name="60Capital-neo4j-ejbPU"
transaction-type="RESOURCE_LOCAL">
<!-- Use the Hibernate OGM provider: configuration will be transparent -->
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.ogm.datastore.provider" value="neo4j_http" />
<property name="hibernate.ogm.datastore.host" value="localhost:7474" />
<property name="hibernate.ogm.datastore.username" value="neo4j" />
<property name="hibernate.ogm.datastore.password" value="demo2017" />
<property name="hibernate.ogm.neo4j.database_path" value="C:/neo4j/database/tutorial" />
<!-- http://docs.jboss.org/hibernate/core/4. ... mmary.html
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform" />
-->
</properties>
</persistence-unit>
</persistence>


Top
 Profile  
 
 Post subject: Re: No Persistence provider for EntityManager for Neo4j
PostPosted: Wed Mar 22, 2017 1:28 pm 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
I've created the following issue:

https://hibernate.atlassian.net/browse/OGM-1263


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.