From 01d465e08bce7a40034205c1f36efb5f65039ff7 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Tue, 10 Sep 2024 01:15:45 -0400 Subject: [PATCH] Use @Qualifier to specify which MessageSource to choose --- .../grails/datastore/mapping/mongo/MongoDatastore.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoDatastore.java b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoDatastore.java index b8014d04..2f7b0fd9 100644 --- a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoDatastore.java +++ b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoDatastore.java @@ -65,8 +65,8 @@ import org.grails.datastore.mapping.transactions.DatastoreTransactionManager; import org.grails.datastore.mapping.transactions.TransactionCapableDatastore; import org.grails.datastore.mapping.validation.ValidatorRegistry; -import org.grails.spring.context.support.PluginAwareResourceBundleMessageSource; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.MessageSource; import org.springframework.context.support.StaticMessageSource; import org.springframework.core.env.PropertyResolver; @@ -578,11 +578,7 @@ public void setCodecs(List> codecs) { * @param messageSource The message source */ @Autowired(required = false) - public void setMessageSource(PluginAwareResourceBundleMessageSource messageSource) { - setMessageSource((MessageSource) messageSource); - } - - public void setMessageSource(MessageSource messageSource) { + public void setMessageSource(@Qualifier("PluginAwareResourceBundleMessageSource") MessageSource messageSource) { if(messageSource != null) { configureValidatorRegistry(connectionSources.getDefaultConnectionSource().getSettings(), (MongoMappingContext) mappingContext, messageSource); }