cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Dependency Cycle

Upgraded to Spring Boot 2.3 (from 2.2) and app won't startup due to dependency cycle

Any idea why Neo4jOgmEntityInstantiatorConfigurationBean dependant on WebMvcAutoConfiguration$EnableWebMvcConfiguration?

3 REPLIES 3

The Neo4jOgmEntityInstantiatorConfigurationBean has no dependency to MVC. But something in the back of my head tells me that I have seen this a few years back already.
Did you go "full in" and also upgraded Spring Data Neo4j to 5.3?
In general this should all work and is -of course- not a special constellation of libraries but very common.
Could you create a reproducer with parts of your existing configuration? I have the vague memory that it was rooted in the definition of conversions (or similar).

Spring Data Neo4J 5.3.9 being the version defined by Spring Boot dependencies (spring-boot-starter-data-neo4j 2.3.12). The only version specified is Spring Boot.

I refactored the code to remove the userService dependency which fixed it.

If I get a chance will try and put together simple case to reproduce.

Thanks for having a look

Yesterday I had by accident while trying to reproduce another reported problem with 2.3 something similar.

I created a "standard" SDN / MVC application without any additional code in the @SpringBootApplication (and with that in any @Configuration) -> worked out of the box.

After this, I just wanted quickly to do some basic stuff on startup and made the main class extend from CommandLineRunner (that is not a problem at all but just want to give you as much information as I can 😉 ) and were then referring to a repository within the @SpringBootApplication/@Configuration.
Also I added a custom Neo4j-OGM Configuration Bean -> Dependency cycle, similar but not the same as yours.

The way, I could break this was to put the Configuration into a separate @Configuration class alongside the @SpringBootApplication. With this, it worked again without any dependency cycles.

Mine might have been simpler but I hope this helps.