INFO warnings about multiple modules in Spring Boot, what do they mean?

45,901

Solution 1

If you are using redis implementing your own persistence layer, you are not using the interface that extends CrudRepository.

That was my case, I just deactivated the redis repositories search and the message below disappeared from my JPA repositories.

Spring Data Redis - Could not safely identify store assignment for repository candidate interface

To disable redis repositories set to false in application.properties:

spring.data.redis.repositories.type = none

In older versions: .repositories.enabled = false

This is already a relief because for many JPA repositories this is pretty annoying.

Solution 2

There is a whole section about in the documents:

http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.multiple-modules

Basically if you are using the generic interfaces (e.g. CrudRepository) then Spring won't know if you want that repository to be backed on the spring-mongodb or spring-redis data modules.

Solution 3

In my case I was using all the annotations correctly, but still got the same error.

I solved by moving the JPA and Mongo repositories to different packages and configuring the base packages for each of the technologies.

@EnableJpaRepositories(basePackages = "com.example.repositories.jpa")
@EnableMongoRepositories(basePackages = "com.example.repositories.mongo")
class ConfigurationClass { ... }

Solution 4

In my case @Document annotation was missing.

I have used multiple modules of Spring Data i.e. Spring Data Mongo and Spring Data Redis.

Share:
45,901
demig0d
Author by

demig0d

Updated on July 09, 2022

Comments

  • demig0d
    demig0d almost 2 years

    I recently bumped up my spring boot version to 1.4.0. Now I see the following warnings below. I am using spring-mongodb and spring-redis (strictly for caching). Is this something I should be concerned about?

    Multiple Spring Data modules found, entering strict repository configuration mode!

    Spring Data Redis - Could not safely identify store assignment for repository

    What does strict repository configuration mode really mean?

        .   ____          _            __ _ _
    /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
    ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
    \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
    '  |____| .__|_| |_|_| |_\__, | / / / /
    =========|_|==============|___/=/_/_/_/
    :: Spring Boot ::        (v1.4.0.RELEASE)
    
    2016-09-11 00:03:11.234  INFO 24766 --- [           main] testapp.Application                     : Starting Application on macbookhome with PID 24766 (/Users/me/Code/testapp/testapp-svc/build/classes/main started by me in /Users/me/Code/testapp/testapp-svc)
    2016-09-11 00:03:11.238  INFO 24766 --- [           main] testapp.Application                     : The following profiles are active: default
    2016-09-11 00:03:11.319  INFO 24766 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7393222f: startup date [Sun Sep 11 00:03:11 EDT 2016]; root of context hierarchy
    2016-09-11 00:03:14.092  INFO 24766 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
    2016-09-11 00:03:14.275  INFO 24766 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
    2016-09-11 00:03:14.346  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.topics.TopicRepository.
    2016-09-11 00:03:14.349  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.entries.EntryRepository.
    2016-09-11 00:03:14.350  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.AppSettingsRepository.
    2016-09-11 00:03:14.351  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.UserRepository.
    2016-09-11 00:03:14.353  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.BookmarkRepository.
    2016-09-11 00:03:14.354  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.FlagRepository.
    2016-09-11 00:03:14.356  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.FollowRepository.
    2016-09-11 00:03:14.360  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.entries.UserEntryRepository.
    2016-09-11 00:03:14.361  INFO 24766 --- [           main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface testapp.repositories.ShareRepository.
    2016-09-11 00:03:14.899  INFO 24766 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'springAsyncConfiguration' of type [class testapp.configuration.SpringAsyncConfiguration$$EnhancerBySpringCGLIB$$2ae6dc36] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2016-09-11 00:03:14.923  INFO 24766 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 
    2016-09-11 00:03:14.939  INFO 24766 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService  'taskExecutor'
    2016-09-11 00:03:14.939  INFO 24766 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'taskExecutor' of type [class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2016-09-11 00:03:15.026  INFO 24766 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cache.annotation.ProxyCachingConfiguration' of type [class org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$26a81448] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2016-09-11 00:03:15.658  INFO 24766 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
    2016-09-11 00:03:15.674  INFO 24766 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
    2016-09-11 00:03:15.675  INFO 24766 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.4
    2016-09-11 00:03:15.801  INFO 24766 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
    2016-09-11 00:03:15.801  INFO 24766 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4487 ms
    2016-09-11 00:03:16.334  INFO 24766 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'metricFilter' to: [/*]
    2016-09-11 00:03:16.335  INFO 24766 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
    2016-09-11 00:03:16.335  INFO 24766 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
    2016-09-11 00:03:16.335  INFO 24766 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
    2016-09-11 00:03:16.336  INFO 24766 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
    2016-09-11 00:03:16.339  INFO 24766 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
    2016-09-11 00:03:16.339  INFO 24766 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webRequestLoggingFilter' to: [/*]
    2016-09-11 00:03:16.340  INFO 24766 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'applicationContextIdFilter' to: [/*]
    2016-09-11 00:03:16.341  INFO 24766 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
    2016-09-11 00:03:17.075  INFO 24766 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[ds041094-a0.mongolab.com:41094, ds041094-a1.mongolab.com:41094], mode=MULTIPLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
    2016-09-11 00:03:17.075  INFO 24766 --- [           main] org.mongodb.driver.cluster               : Adding discovered server ds041094-a0.mongolab.com:41094 to client view of cluster
    2016-09-11 00:03:17.100  INFO 24766 --- [           main] org.mongodb.driver.cluster               : Adding discovered server ds041094-a1.mongolab.com:41094 to client view of cluster
    2016-09-11 00:03:17.863  INFO 24766 --- [golab.com:41094] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:2, serverValue:976946}] to ds041094-a0.mongolab.com:41094
    2016-09-11 00:03:17.888  INFO 24766 --- [golab.com:41094] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=ds041094-a0.mongolab.com:41094, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 0, 7]}, minWireVersion=0, maxWireVersion=3, maxDocumentSize=16777216, roundTripTimeNanos=24085956, setName='rs-ds041094', canonicalAddress=ds041094-a0.mongolab.com:41094, hosts=[ds041094-a0.mongolab.com:41094, ds041094-a1.mongolab.com:41094], passives=[], arbiters=[ds041094-ar0.mongolab.com:41094], primary='ds041094-a0.mongolab.com:41094', tagSet=TagSet{[]}, electionId=5736155bb89bc895bfdb9c2f, setVersion=3}
    2016-09-11 00:03:17.890  INFO 24766 --- [golab.com:41094] org.mongodb.driver.cluster               : Discovered cluster type of REPLICA_SET
    2016-09-11 00:03:17.890  INFO 24766 --- [golab.com:41094] org.mongodb.driver.cluster               : Adding discovered server ds041094-ar0.mongolab.com:41094 to client view of cluster
    2016-09-11 00:03:17.891  INFO 24766 --- [golab.com:41094] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:1, serverValue:1178641}] to ds041094-a1.mongolab.com:41094
    2016-09-11 00:03:17.892  INFO 24766 --- [golab.com:41094] org.mongodb.driver.cluster               : Setting max election id to 5736155bb89bc895bfdb9c2f from replica set primary ds041094-a0.mongolab.com:41094
    2016-09-11 00:03:17.892  INFO 24766 --- [golab.com:41094] org.mongodb.driver.cluster               : Setting max set version to 3 from replica set primary ds041094-a0.mongolab.com:41094
    2016-09-11 00:03:17.892  INFO 24766 --- [golab.com:41094] org.mongodb.driver.cluster               : Discovered replica set primary ds041094-a0.mongolab.com:41094
    2016-09-11 00:03:17.943  INFO 24766 --- [golab.com:41094] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=ds041094-a1.mongolab.com:41094, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 0, 7]}, minWireVersion=0, maxWireVersion=3, maxDocumentSize=16777216, roundTripTimeNanos=51084368, setName='rs-ds041094', canonicalAddress=ds041094-a1.mongolab.com:41094, hosts=[ds041094-a0.mongolab.com:41094, ds041094-a1.mongolab.com:41094], passives=[], arbiters=[ds041094-ar0.mongolab.com:41094], primary='ds041094-a0.mongolab.com:41094', tagSet=TagSet{[]}, electionId=null, setVersion=3}
    2016-09-11 00:03:18.108  INFO 24766 --- [golab.com:41094] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:3, serverValue:2200709}] to ds041094-ar0.mongolab.com:41094
    2016-09-11 00:03:18.155  INFO 24766 --- [golab.com:41094] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=ds041094-ar0.mongolab.com:41094, type=REPLICA_SET_ARBITER, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 0, 7]}, minWireVersion=0, maxWireVersion=3, maxDocumentSize=16777216, roundTripTimeNanos=46937906, setName='rs-ds041094', canonicalAddress=ds041094-ar0.mongolab.com:41094, hosts=[ds041094-a0.mongolab.com:41094, ds041094-a1.mongolab.com:41094], passives=[], arbiters=[ds041094-ar0.mongolab.com:41094], primary='ds041094-a0.mongolab.com:41094', tagSet=TagSet{[]}, electionId=null, setVersion=3}
    2016-09-11 00:03:18.357  INFO 24766 --- [           main] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:4, serverValue:976947}] to ds041094-a0.mongolab.com:41094
    2016-09-11 00:03:20.185  INFO 24766 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/css/**'], Ant [pattern='/js/**'], Ant [pattern='/images/**'], Ant [pattern='/webjars/**'], Ant [pattern='/**/favicon.ico'], Ant [pattern='/error']]], []
    2016-09-11 00:03:20.186  INFO 24766 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/health'], []
    2016-09-11 00:03:20.186  INFO 24766 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/1.0/users/auth0/userInfo'], []
    2016-09-11 00:03:20.186  INFO 24766 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/1.0/users/username/valid'], []
    2016-09-11 00:03:20.314  INFO 24766 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@7cd3860, org.springframework.security.web.context.SecurityContextPersistenceFilter@3601549f, org.springframework.security.web.header.HeaderWriterFilter@4e789704, org.springframework.security.web.authentication.logout.LogoutFilter@18f4086e, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@228958a, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@1b9c716f, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@22854f2b, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@44f23927, org.springframework.security.web.session.SessionManagementFilter@1e6bd367, org.springframework.security.web.access.ExceptionTranslationFilter@3205610d, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@5b2ff4df]
    2016-09-11 00:03:20.323  INFO 24766 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration$LazyEndpointPathRequestMatcher@253b1cbd, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@a859c5, org.springframework.security.web.context.SecurityContextPersistenceFilter@c335b9, org.springframework.security.web.header.HeaderWriterFilter@87fc0fc, org.springframework.security.web.authentication.logout.LogoutFilter@1e66bf2d, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@75f2ff80, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@75c8d8e7, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@3c68e82, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@37083af6, org.springframework.security.web.session.SessionManagementFilter@671f545b, org.springframework.security.web.access.ExceptionTranslationFilter@74a03bd5, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@3831f4c2]
    2016-09-11 00:03:20.642  INFO 24766 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7393222f: startup date [Sun Sep 11 00:03:11 EDT 2016]; root of context hierarchy
    2016-09-11 00:03:20.746  INFO 24766 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/info],methods=[GET],produces=[application/json]}" onto public java.util.HashMap<java.lang.String, java.lang.String> testapp.controllers.AppInfoController.getAppInfo()
    2016-09-11 00:03:20.789  INFO 24766 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/1.0/topics/user/{username}],methods=[GET]}" onto public org.springframework.data.domain.Page<testapp.models.Topic> testapp.controllers.api.v1.topic.TopicController.getTopicsByCategory(java.lang.String,java.lang.String,int,int,java.lang.String,java.lang.String,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    2016-09-11 00:03:20.791  INFO 24766 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
    2016-09-11 00:03:20.792  INFO 24766 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    2016-09-11 00:03:20.938  INFO 24766 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
    2016-09-11 00:03:20.939  INFO 24766 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
    2016-09-11 00:03:20.988  INFO 24766 --- [           main] .m.m.a.ExceptionHandlerExceptionResolver : Detected @ExceptionHandler methods in testappSvcExceptionHandler
    2016-09-11 00:03:21.046  INFO 24766 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
    2016-09-11 00:03:21.755  INFO 24766 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/health || /health.json],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(java.security.Principal)
    2016-09-11 00:03:21.759  INFO 24766 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
    2016-09-11 00:03:21.759  INFO 24766 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
    2016-09-11 00:03:22.047  INFO 24766 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
    2016-09-11 00:03:22.061  INFO 24766 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
    2016-09-11 00:03:22.193  INFO 24766 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
    2016-09-11 00:03:22.234  INFO 24766 --- [           main] testapp.Application                     : Started Application in 11.601 seconds (JVM running for 12.241)
    2016-09-11 00:06:17.685  INFO 24766 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
    2016-09-11 00:06:17.685  INFO 24766 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization started
    2016-09-11 00:06:17.719  INFO 24766 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 34 ms
    
  • demig0d
    demig0d over 7 years
    I'm not using the generic ones, I'm using extends MongoRepository and Document annotations on my model objects. I'm only using the Cacheable methods for redis in one particular repository. How come it can't figure that out??
  • mp911de
    mp911de over 7 years
    Spring Data Redis 1.7 comes with Repository support. All it's saying is that Spring Data Redis cannot identify responsibility for your MongoDB repositories and so it does not provide instances for these repos.
  • nitinsridar
    nitinsridar over 5 years
    What is the solution to solve this problem? I'm working on JPA and Spring-boot redis and data are saving in MySql not in redis, please help