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); }