Hi Fabio, Any news on your issue? It's now also mine, but again no answer, maybe too trivial or nobody uses MonogDB that way. I run into this problem if using MongoDB for Service- AND Ticket-Registry AND Spring-Session. In your case disabling auto config for spring data should fix this, it was actually added with commit https://github.com/apereo/cas/commit/5b65786e50ba3b6c3b7c70b03391fa880072f153
## # Excluded auto-configuration classes # spring.autoconfigure.exclude= \ org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\ org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration,\ org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration But if you instead also need MongoDataAutoConfiguration, i.e. for enabling spring session, the problem is back. Since the bean creation in 6.4.4.2 is not even strictly necessary in my or our case, it is just creating the problem for no reason(?). I patched the modules https://github.com/springernature/cas/commit/15e0b627d6b15faebcdb7f7756339bd60f8bc5e1 to make this also working, but patching is the worst solution imho. My message is found here: https://groups.google.com/a/apereo.org/g/cas-user/c/L0dAv358Lxo/m/cLcFhZ3VAgAJ Regards Martin On Wednesday, October 27, 2021 at 12:10:02 PM UTC+2 Fabio Bettiol wrote: > Error shows on versions *6.4.0-RC1*2 and up to 6.5.* > > El miércoles, 27 de octubre de 2021 a las 12:05:07 UTC+2, Fabio Bettiol > escribió: > >> Hi. >> I managed to solve -temporarily, at least- this issue lowering the >> version for to: >> >> build.gradle: >> >> ... >> implementation 'org.apereo.cas:cas-server-support-mongo-ticket-registry >> *:6.4.0-RC1*' >> ... >> >> Described error on my previous post shows up with the default version for >> cas 6.4.2 >> >> El lunes, 18 de octubre de 2021 a las 19:48:43 UTC+2, Fabio Bettiol >> escribió: >> >>> Hi guys.... Any ... ? >>> >>> El lunes, 11 de octubre de 2021 a las 10:05:18 UTC+2, Fabio Bettiol >>> escribió: >>> >>>> Hi. >>>> While trying to deploy Mongo Service Registry and Mongo Ticket Registry >>>> (CAS 6.4.0), I get the following error (both services currently working >>>> fine in 6.3.2, same server): >>>> >>>> *Error upon running sudo ./gradle run --info* >>>> >>>> *************************** >>>> APPLICATION FAILED TO START >>>> *************************** >>>> >>>> Description: >>>> >>>> Parameter 1 of method gridFsTemplate in >>>> org.springframework.boot.autoconfigure.data.mongo.MongoDatabaseFactoryDependentConfiguration >>>> >>>> required a single bean, but 2 were found: >>>> - mongoDbServiceRegistryTemplate: defined by method >>>> 'mongoDbServiceRegistryTemplate' in class path resource >>>> [org/apereo/cas/config/MongoDbServiceRegistryConfiguration.class] >>>> - mongoDbTicketRegistryTemplate: defined in BeanDefinition >>>> defined in class path resource >>>> [org/apereo/cas/config/MongoDbTicketRegistryConfiguration.class] >>>> >>>> Action: >>>> >>>> Consider marking one of the beans as @Primary, updating the consumer to >>>> accept multiple beans, or using @Qualifier to identify the bean that >>>> should >>>> be consumed >>>> > >>>> >>>> > Task :run FAILED >>>> >>>> >>>> >>>> *From gradle.build: * >>>> >>>> implementation >>>> "org.apereo.cas:cas-server-support-mongo:${project.'cas.version'}" >>>> implementation >>>> "org.apereo.cas:cas-server-support-mongo-service-registry:${project.'cas.version'}" >>>> implementation >>>> "org.apereo.cas:cas-server-support-mongo-ticket-registry:${project.'cas.version'}" >>>> >>>> >>>> >>>> *From cas.proiperties:* >>>> >>>> # ======================= >>>> # MongoDB Vars >>>> # ======================= >>>> mongo.db:dbnamehere >>>> mongo.creds:userhere:passwordhere >>>> mongo.hosts:localhost >>>> mongo.uri:mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db} >>>> >>>> # ======================= >>>> # MongoDB Authentication >>>> # ======================= >>>> >>>> cas.authn.mongo.client-uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db} >>>> cas.authn.mongo.collection=ticketGrantingTicketsCollection >>>> cas.authn.mongo.database-name=dbnamehere >>>> cas.authn.mongo.host=localhost >>>> cas.authn.mongo.password=passwordhere >>>> >>>> # ======================= >>>> # MongoDB Ticket registry >>>> # ======================= >>>> >>>> cas.ticket.registry.mongo.client-uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db} >>>> cas.ticket.registry.mongo.database-name=dbnamehere >>>> cas.ticket.registry.mongo.host=localhost >>>> cas.ticket.registry.mongo.password= passwordhere >>>> cas.ticket.registry.mongo.port=27017 >>>> >>>> # ======================= >>>> # Mongo DB Service registry >>>> # ======================= >>>> >>>> cas.service-registry.mongo.client-uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db} >>>> cas.service-registry.mongo.collection:casServiceRegistry >>>> cas.service-registry.mongo.database-name=dbnamehere >>>> cas.service-registry.mongo.host=localhost >>>> cas.service-registry.mongo.password= passwordhere >>>> >>>> >>>> Any help will be appreciated. >>>> Thank you. >>>> >>>> Fabio. >>>> >>> -- - Website: https://apereo.github.io/cas - Gitter Chatroom: https://gitter.im/apereo/cas - List Guidelines: https://goo.gl/1VRrw7 - Contributions: https://goo.gl/mh7qDG --- You received this message because you are subscribed to the Google Groups "CAS Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/29fc82b6-b15c-4275-8cde-77f5997bdb25n%40apereo.org.
