玩 Morphia MongoDB :类型 Filter 已经定义
当尝试使用 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!)
~ ...
When trying to launch a Play Java application with Morphia for MongoDB, I get the following stacktrace, caused by a recompilation of the Filter type that is already compiled :
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!)
~ ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当从 application.conf 和 dependency.yml 加载 morphia 模块时会出现此问题。
要解决此问题,请转到 application.conf 并注释掉下面的行“load
吗啡模块”,然后重新启动 Play。
This problem happens when the morphia module is being loaded from both the application.conf and dependencies.yml
To resolve it, go to your application.conf and comment out the line below "load
morphia module", then restart Play.