0
votes

I am using MongoDb and Neo4j in my Spring Boot Application. I have recently updated by Spring Boot Gradle Plugin from 1.2.6 to 1.5.7.

I am having two config files one for mongo and other for neo4j. After updating the version of spring boot I found that @EnableMongoRepositories and @EnableNeo4jRepositories are showing following errors in their respective config files:

No constructor with 1 argument defined in class
'org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean'

No constructor with 1 argument defined in class 'org.springframework.data.neo4j.repository.support.GraphRepositoryFactoryBean'

I am having following annotations in neo4j config:

@Configuration
@EnableNeo4jRepositories("<packagename>.neo4j.repository") @EnableTransactionManagement
public class DatabaseConfigurationNeo4j extends Neo4jConfiguration
{
...
}

and following annotations in mongo config:

@Configuration
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
@EnableMongoRepositories("<packagename>.repository")
@Import(value = MongoAutoConfiguration.class)
@EnableMongoAuditing(auditorAwareRef = "springSecurityAuditorAware")
public class DatabaseConfiguration extends AbstractMongoConfiguration
{
...
}

If I remove these @EnableRepositories line from the files, these errors are removed but when I run it, the repositories bean are not creating. I think these lines are necessary but dont know how to remove this error.

Thank you.

1

1 Answers

0
votes

updating spring-neo4j to 4.2.8 (not 5.0.0 as neo4j 5.0.0 will work with spring-boot 2.0 M and above) and spring-mongo to 1.10.6 solved the configuration issues.