Error creating bean with name 'mongoTemplate'

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


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

链接地址: http://www.djcxy.com/p/68772.html

上一篇: 我正在创建购物车,并且出现一些错误

下一篇: 创建名称为'mongoTemplate'的bean时出错