缺少类org.springframework.objenesis.ObjenesisStd [英] Missing class org.springframework.objenesis.ObjenesisStd
问题描述
我正在尝试将Spring Data用于MongoDB.我正在使用MongoDB的全文本搜索功能,并且想对文本索引字段(@TextIndexed
)尝试使用Spring Data批注. Spring Data MongoDB的1.6.0.BUILD-SNAPSHOT中提供了此功能.
I am trying to use Spring Data for MongoDB. I am using full text search feature of MongoDB, and wanted to try Spring Data annotations for text index fields (@TextIndexed
). This feature is available in 1.6.0.BUILD-SNAPSHOT of Spring Data MongoDB.
我正在尝试在Spring中设置简单的应用程序上下文并运行简单的JUnit测试.但是,由于将1.5.1.RELEASE更改为1.6.0.BUILD-SNAPSHOT,因此我的应用程序上下文加载失败.
I am trying to setup simple application context in Spring and to run simple JUnit test. However my application context loading fails since I changed 1.5.1.RELEASE to 1.6.0.BUILD-SNAPSHOT.
我得到的错误如下:
Caused by: org.springframework.beans.BeanInstantiationException: Could
not instantiate bean class
[org.springframework.data.mongodb.core.MongoTemplate]: Constructor
threw exception; nested exception is java.lang.NoClassDefFoundError:
org/springframework/objenesis/ObjenesisStd at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163) at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121) at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280)
... 51 more Caused by: java.lang.NoClassDefFoundError:
org/springframework/objenesis/ObjenesisStd at
org.springframework.data.mongodb.core.convert.DefaultDbRefResolver.<init>(DefaultDbRefResolver.java:72) at
org.springframework.data.mongodb.core.MongoTemplate.getDefaultMongoConverter(MongoTemplate.java:1961) at
org.springframework.data.mongodb.core.MongoTemplate.<init>(MongoTemplate.java:210) at
org.springframework.data.mongodb.core.MongoTemplate.<init>(MongoTemplate.java:174) at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at
java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
... 53 more Caused by: java.lang.ClassNotFoundException:
org.springframework.objenesis.ObjenesisStd at
java.net.URLClassLoader$1.run(URLClassLoader.java:202) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
java.lang.ClassLoader.loadClass(ClassLoader.java:247)
现在,我尝试使用grepcode.com找出哪个JAR包含org.springframework.objenesis.ObjenesisStd
,但是它无法返回任何与Spring相关的JAR.
Now, I tried to figure out which JAR contains org.springframework.objenesis.ObjenesisStd
by using grepcode.com, but it can't return any Spring related JARs.
我在这里想念什么?
推荐答案
Spring Data MongoDB 1.6 will require Spring Framework 4 as indicated on the release train's wiki page. Spring Framework 4 contains the class the exception is complaining about.
这篇关于缺少类org.springframework.objenesis.ObjenesisStd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!