diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/MongoReactiveSessionConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/MongoReactiveSessionConfiguration.java index d5cdeb81c9..42965a2de1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/MongoReactiveSessionConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/MongoReactiveSessionConfiguration.java @@ -27,6 +27,7 @@ import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.core.ReactiveMongoOperations; import org.springframework.session.ReactiveSessionRepository; +import org.springframework.session.data.mongo.ReactiveMongoOperationsSessionRepository; import org.springframework.session.data.mongo.config.annotation.web.reactive.ReactiveMongoWebSessionConfiguration; /** @@ -35,7 +36,8 @@ import org.springframework.session.data.mongo.config.annotation.web.reactive.Rea * @author Andy Wilkinson */ @Configuration -@ConditionalOnClass(ReactiveMongoWebSessionConfiguration.class) +@ConditionalOnClass({ ReactiveMongoOperations.class, + ReactiveMongoOperationsSessionRepository.class }) @ConditionalOnMissingBean(ReactiveSessionRepository.class) @ConditionalOnBean(ReactiveMongoOperations.class) @Conditional(ReactiveSessionCondition.class)