[cas-user] gridFsTemplate ... required a single bean ... MongoDB

2 views
Skip to first unread message

Fabio Bettiol

unread,
Oct 11, 2021, 4:05:21 AMOct 11
to CAS Community
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 cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/3dffc03a-83b2-474c-bf93-a6abace02441n%40apereo.org.

Fabio Bettiol

unread,
Oct 18, 2021, 1:48:46 PMOct 18
to CAS Community, Fabio Bettiol

Fabio Bettiol

unread,
Oct 27, 2021, 6:05:09 AMOct 27
to CAS Community, Fabio Bettiol
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
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/80f14bc2-619d-472f-92ed-f147db01111dn%40apereo.org.

Fabio Bettiol

unread,
Oct 27, 2021, 6:10:03 AMOct 27
to CAS Community, Fabio Bettiol
Error shows on versions 6.4.0-RC12 and up to 6.5.*
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/870f7f2e-d451-4d54-afc7-56dc1161a3edn%40apereo.org.
Reply all
Reply to author
Forward
0 new messages