mercredi 25 février 2015

springboot initialization error on startup with mongodb on gorm/groovy

Getting startup issues for this springboot project using MongoDB/GORM/Groovy on Java 1.7.0_55, gradle 1.11, and spring-boot-gradle-plugin:1.2.1.RELEASE.


I'm running the project as-is with the exception of the following change to application.yml for my remote mongodb:



spring:
mongodb:
host: "10.160.8.1"
databaseName: "citydb"


**On startup, I'm seeing this bean initialization error with mappingMongoConverter



Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mongoTemplate' defined in class path resource [org/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.class]:
Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.data.mongodb.core.convert.MongoConverter]: : Error creating bean with name 'mappingMongoConverter' defined in class path resource [org/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.class]:
Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.data.mongodb.core.mapping.MongoMappingContext]: : No qualifying bean of type [org.springframework.data.mongodb.core.mapping.MongoMapping
Context] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.data.mongodb.core.mapping.MongoMappingCo
ntext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mappingMongoConverter' defined in class path resource [org
/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 1 of typ
e [org.springframework.data.mongodb.core.mapping.MongoMappingContext]: : No qualifying bean of type [org.springframework.data.mongodb.core.mapping.MongoMappin
gContext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested excepti
on is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.data.mongodb.core.mapping.MongoMappingC
ontext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}


I think this is the main issue:



Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mappingMongoConverter' defined in class path resou
rce [org/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index
1 of type [org.springframework.data.mongodb.core.mapping.MongoMappingContext]: : No qualifying bean of type [org.springframework.data.mongodb.core.mapping.Mon
goMappingContext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested
exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.data.mongodb.core.mapping.Mongo
MappingContext] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:464)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:
1111)


Could this be a GORM dependency issue? I'm using the latest, org.grails:gorm-mongodb-spring-boot:1.1.0.RELEASE


Tracked as issue on github: http://ift.tt/1A6dZTi


Aucun commentaire:

Enregistrer un commentaire