我在配置MongoDB的时候,使用MongoTemplate方式去操作MongoDB,但是在配置的时候发现无法使用svae()方法对domain进行保存,如果使用Json工具将对象转化为Json数据的话就可以保存到mongoDB。报如下错误
严重: Servlet.service() for servlet [springServlet] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.springframework.util.Assert.isTrue(ZLjava/util/function/Supplier;)V] with root cause
java.lang.NoSuchMethodError: org.springframework.util.Assert.isTrue(ZLjava/util/function/Supplier;)V
at org.springframework.data.mapping.model.BasicPersistentEntity.getPropertyAccessor(BasicPersistentEntity.java:427)
at org.springframework.data.mongodb.core.MongoTemplate.assertUpdateableIdIfNotSet(MongoTemplate.java:1563)
at org.springframework.data.mongodb.core.MongoTemplate.doSave(MongoTemplate.java:1262)
at org.springframework.data.mongodb.core.MongoTemplate.save(MongoTemplate.java:1212)
at com.rongdu.cashloan.core.mongo.service.TestService.save(TestService.java:30)
at com.rongdu.cashloan.core.mongo.service.TestService$$FastClassBySpringCGLIB$$34a70ff2.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
这是我的spring配置文件:
有哪位大神对这方面了解的,求教