Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using spring-data-neo4j and spring-data-mongo confuse the spring data rest [DATAREST-1525] #1826

spring-projects-issues opened this issue May 31, 2020 · 0 comments


Copy link

@spring-projects-issues spring-projects-issues commented May 31, 2020

fssrepository opened DATAREST-1525 and commented

spring boot 2.3.0.RELEASE - I'm not sure about Neumann - (used kotlin also, but i do feel it's unrelated)

  1. If you have two repositories with the same name but in a different package.
    One extends from neo4j, but not from rest (only @Repository - with Neo4jRepository), the other one is mongo, but with @RepositoryRestResource. Accessing the resource by curl, getting back the Neo4jRepository and inserts to the neo4j db. Instead of mongodb.
    I just injected the neo4j repository to the mongo eventhandler after create. Renaming one of the Repository and addign @EntityScan("") solving this problem.
  2. setting up the following in the config
    @EnableMongoRepositories(basePackageClasses = [MongoRepository::class])
    @EnableNeo4jRepositories(basePackageClasses = [Neo4jRepository::class])
    Causing: (the neo4j alone causing this problem - many similar problem has been raised, but this flavor not)


Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' availableCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available at ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] at ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] at ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] at ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor.postProcessBeforeInitialization( ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE] at ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] at ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] at ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]


        3. If you won't set @EntityScan("") in the config
            Neo4j scans @Document/@QueryEntity also, and throwing warnings/info:

2020-05-31 23:19:44.256 INFO 25245 — [ main] o.s.d.neo4j.mapping.Neo4jMappingContext : No class information found in OGM meta-data for class so treating as simple type for SD Commons
2020-05-31 23:19:44.267 WARN 25245 — [ main] o.s.d.n.mapping.Neo4jPersistentProperty : Owning ClassInfo is null for property: org.springframework.context.ApplicationContext.parent

I do feel, that it needs to ignore unrelated annotations in the first place. Repositories has been extended by two different class. (MongoRepository/Neo4jRepository) and the model classes also using different annotations

Affects: 3.3 GA (Neumann)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants