This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Issue with circular reference

Jul 26th, 2012, 03:21 AM

Hi -

I am creating web app with the ability of cross-store persisting data to SQL and No-SQL database. I am using spring-3.1.2, spring-data-neo4j-2.1.0-RC2 and spring-data-jpa-1.1.0.RELEASE.
Since I am new to neo4j and do not have much experience with Spring, I have started with creating neo4j entities and repositories. I was able to make it working, the data was persisted to graph db - excellent. Bellow is the code of neo4j repositories (looks like the problem may be here):

As you see I have created the implementation of GraphRepository and NamedIndexRepository with my custom method createDenysEntity. I reused this approach from spring-data-neo4j-reference - everything works fine.

After that I have started to add spring-data-jpa entities and started to get the following error: Exception in thread "main" org.springframework.beans.factory.BeanCurrentlyInC reationException: Error creating bean with name 'denysEntityRepositoryImpl': Bean with name 'denysEntityRepositoryImpl' has been injected into other beans [denysEntityRepository] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.

Not sure why do I have this error now? I didn't have it before and was not making changes to neo4j repositories. I was also thinking about some versioning issue, but this is not the case (I believe) because I have created two projects: one of them just with neo4j logic and another one with both neo4j and spring-data-jpa logic (I created the second project just to figure out the reason of the issue that I have). These two projects have identical classpaths, so I think that some new jar files are not the reason of the issue that I have. I see now only one difference: spring-context.xml. Now it looks as follows: