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

Spring Data MongoDB reactive autoconfig not working with 2.3.0.RELEASE #21561

Closed
sahrawat opened this issue May 25, 2020 · 1 comment
Closed
Labels
type: wiki-documentation A documentation update required on the wiki

Comments

@sahrawat
Copy link

sahrawat commented May 25, 2020

Here are my pom.xml dependencies generated from https://start.spring.io

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
</dependency>
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-test</artifactId>
	<scope>test</scope>
	<exclusions>
		<exclusion>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
		</exclusion>
	</exclusions>
</dependency>
<dependency>
	<groupId>io.projectreactor</groupId>
	<artifactId>reactor-test</artifactId>
	<scope>test</scope>
</dependency>

To reproduce this issue, just @Autowire MongoOperations ops. This configuration works with 2.2.6.RELEASE without any issues.

The error is:

Consider defining a bean of type 'org.springframework.data.mongodb.core.MongoOperations' in your configuration.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 25, 2020
@snicoll snicoll added type: wiki-documentation A documentation update required on the wiki and removed status: waiting-for-triage An issue we've not yet triaged labels May 25, 2020
@snicoll
Copy link
Member

snicoll commented May 25, 2020

MongoOperations is the imperative (non reactive) variant. The new MongoDB driver has harmonized their infrastructure with a clear split so that is expected. If you need the imperative variant, you need to add spring-boot-starter-data-mongodb.

I've polished the release notes to reflect that information.

@snicoll snicoll closed this as completed May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: wiki-documentation A documentation update required on the wiki
Projects
None yet
Development

No branches or pull requests

3 participants