升级到1.7.0.RELEASE后的NoClassDefFoundError

时间:2015-04-10 14:02:39

标签: playframework-2.3 spring-data-mongodb

我试图在我的playframework项目中将我的应用程序从1.6.2.RELEASE升级到1.7.0.RELEASE。 插入查询工作正常,但是当spring-data在查询结果后尝试使用类名对对象进行膨胀时似乎存在问题,如果对查询没有结果,则返回空arraylist而不抛出错误。

1.7.0.RELEASE在另一个基于spring-integration框架的项目中运行良好。

下面是statck trace: -

java.lang.NoClassDefFoundError: models/db/nosql/ACME
 models.db.nosql.ACME_Instantiator_gtblf6.newInstance(Unknown Source)
 org.springframework.data.convert.BytecodeGeneratingEntityInstantiator$EntityInstantiatorAdapter.createInstance(BytecodeGeneratingEntityInstantiator.java:193)
 org.springframework.data.convert.BytecodeGeneratingEntityInstantiator.createInstance(BytecodeGeneratingEntityInstantiator.java:76)
 org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:250)
 org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:231)
 org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:191)
 org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:187)
 org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:78)
 org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:2191)
 org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:1873)
 org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1696)
 org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1679)
 org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:598)
 org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:589)
 GenerateACME.reverseBizCode(GenerateACME.java:42)
 Global.onStart(Global.java:23)
 play.core.j.JavaGlobalSettingsAdapter.onStart(JavaGlobalSettingsAdapter.scala:22)
 play.api.GlobalPlugin.onStart(GlobalSettings.scala:220)
 play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
 play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
 scala.collection.immutable.List.foreach(List.scala:383)
 play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
 play.api.Play$$anonfun$start$1.apply(Play.scala:91)
 play.api.Play$$anonfun$start$1.apply(Play.scala:91)
 play.utils.Threads$.withContextClassLoader(Threads.scala:21)
 play.api.Play$.start(Play.scala:90)
 play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:157)
 play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:130)
 scala.Option.map(Option.scala:145)
 play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:130)
 play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:128)
 scala.util.Success.flatMap(Try.scala:230)
 play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:128)
 play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:120)
 scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
 scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
 scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361)
 scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
 scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
 scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
 scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

1 个答案:

答案 0 :(得分:-1)

我也面临这个错误。我认为这是春天数据mongodb的错误。

如果Db模型和所有服务,存储库都在一个项目中,则没有这样的错误。 但如果服务在另一个项目中,则可以100%再现。我找不到避免此错误的方法。

现在,我正在尝试在mongodb持久层上使用OGM。