Neo4j-ogm with hibernate-orm in the same project causing issues in maven clean install

(Abhishek Kulkarni) #1

I am finding the error below while integrating my project

ERROR ::: Cannot convert value of type [org.hibernate.impl.SessionFactoryImpl] to required type [org.neo4j.ogm.session.SessionFactory]: no matching editors or conversion strategy found

full log

0 Likes

(Gerrit Meier) #2

When using both libraries you have to define the name of your Neo4j-OGM SessionFactory bean explicitly like
@EnableNeo4jRepositories(sessionFactoryRef = CUSTOM_SESSION_FACTORY_BEAN_NAME)
Otherwise Spring Data Neo4j will look for a bean called sessionFactory that gets created from the Spring Data JPA Spring Boot starter "first". This is the reason why you are facing this exception.

0 Likes