Reputation: 11
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplate' defined in class com.socketcruiter.config.SpringMongoConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.mongodb.core.MongoTemplate org.springframework.data.mongodb.config.AbstractMongoConfiguration.mongoTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingMongoConverter' defined in class com.socketcruiter.config.SpringMongoConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.mongodb.core.convert.MappingMongoConverter org.springframework.data.mongodb.config.AbstractMongoConfiguration.mappingMongoConverter() throws java.lang.Exception] threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.data.util.ClassTypeInformation.from(Ljava/lang/Class;)Lorg/springframework/data/util/ClassTypeInformation;
i have the following config
<mongo:mongo host="127.0.0.1" port="27017" />
<mongo:db-factory dbname="ssss" />
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
</bean>
and im using org.springframework.data spring-data-mongodb 1.7.1.RELEASE
Upvotes: 1
Views: 11815
Reputation: 1
If the user name and password of your monogodb are empty, comment it out in the configuration file and debug it again.
Upvotes: 0
Reputation: 1298
Check if you have the correct jar in your class path. You would need spring-data-commons-core jar, here is the latest version: http://mvnrepository.com/artifact/org.springframework.data/spring-data-commons-core/1.4.1.RELEASE
Upvotes: 0