当尝试使用Morphia for MongoDB启动Play Java应用程序时,我得到以下堆栈跟踪,这是由已经编译的Filter类型的重新编译引起的:
Internal Server Error (500) for request GET /
Compilation error (In {module:morphia-1.2.3d}/app/morphia/Filter.java around line 8)
The file {module:morphia-1.2.3d}/app/morphia/Filter.java could not be compiled. Error raised is : The type Filter is already defined
play.exceptions.CompilationException: The type Filter is already defined at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:246)
at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:672)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:516)
at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:278)
at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:412)
at play.Play.start(Play.java:485)
at play.Play.detectChanges(Play.java:599)
at play.Invoker$Invocation.init(Invoker.java:186)
at Invocation.HTTP Request(Play!)
~ ...
答案 0 :(得分:2)
从application.conf和dependencies.yml
加载morphia模块时会发生此问题要解决此问题,请转到您的application.conf并注释掉下面的行“load “morphia module”,然后重新开始播放。
# load morphia module
#module.morphia=${play.path}/modules/morphia-1.2.3d