使用 Scala 配置 Play 框架以使用 Neo4j 图形数据库
我在我的应用程序中使用 scala,它运行没有问题,但如果我在依赖项中添加 neo4j,它会引发 NoSuchMethod 错误。我什至没有在我的代码中引用任何 Neo4j 类...
我使用 scala 的 play 框架或 Neo4j 的 play 框架(Java)都没有问题,只是当两者一起使用时,它崩溃了...
我尝试过neo4j 1.4.2 和 1.5.M02 均无效。
感谢您的帮助~
Chris
dependency.yml
# Application dependencies
require:
- play
- play -> scala 0.9.1
- org.neo4j -> neo4j 1.4.2
异常详细信息:
play.exceptions.UnexpectedException: Unexpected Error
at play.Invoker$Invocation.onException(Invoker.java:232)
at play.Invoker$Invocation.run(Invoker.java:273)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NoSuchMethodError: scala.collection.generic.GenericTraversableTemplate.flatten(Lscala/Function1;)Lscala/collection/Traversable;
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:18)
at play.scalasupport.compiler.PlayScalaCompiler$$anonfun$scanFiles$1.apply(ScalaCompiler.scala:17)
at play.scalasupport.compiler.PlayScalaCompiler$$anonfun$scanFiles$1.apply(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$$anonfun$scanFiles$1.apply(ScalaCompiler.scala:17)
at play.scalasupport.compiler.PlayScalaCompiler$$anonfun$scanFiles$1.apply(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:15)
at play.scalasupport.ScalaPlugin$$anonfun$templates$1.apply(ScalaPlugin.scala:178)
at play.scalasupport.ScalaPlugin$$anonfun$templates$1.apply(ScalaPlugin.scala:177)
at play.scalasupport.ScalaPlugin.templates(ScalaPlugin.scala:177)
at play.scalasupport.ScalaPlugin.update(ScalaPlugin.scala:195)
at play.scalasupport.ScalaPlugin.detectClassesChange(ScalaPlugin.scala:107)
at play.plugins.PluginCollection.detectClassesChange(PluginCollection.java:358)
at play.Play.detectChanges(Play.java:594)
at play.Invoker$Invocation.init(Invoker.java:186)
... 1 more
I'm using scala in my app, it run without problem, but if I add neo4j in the dependencies, it throws a NoSuchMethod error. I didn't even have references to any neo4j classes in my code...
I have no problem using play framework with scala, or play framework (Java) with neo4j, just when using both together, it crash...
and I tried both neo4j 1.4.2 and 1.5.M02 to no avail.
thanks for any help~
Chris
dependencies.yml
# Application dependencies
require:
- play
- play -> scala 0.9.1
- org.neo4j -> neo4j 1.4.2
exception details:
play.exceptions.UnexpectedException: Unexpected Error
at play.Invoker$Invocation.onException(Invoker.java:232)
at play.Invoker$Invocation.run(Invoker.java:273)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NoSuchMethodError: scala.collection.generic.GenericTraversableTemplate.flatten(Lscala/Function1;)Lscala/collection/Traversable;
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:18)
at play.scalasupport.compiler.PlayScalaCompiler$anonfun$scanFiles$1.apply(ScalaCompiler.scala:17)
at play.scalasupport.compiler.PlayScalaCompiler$anonfun$scanFiles$1.apply(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$anonfun$scanFiles$1.apply(ScalaCompiler.scala:17)
at play.scalasupport.compiler.PlayScalaCompiler$anonfun$scanFiles$1.apply(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:15)
at play.scalasupport.ScalaPlugin$anonfun$templates$1.apply(ScalaPlugin.scala:178)
at play.scalasupport.ScalaPlugin$anonfun$templates$1.apply(ScalaPlugin.scala:177)
at play.scalasupport.ScalaPlugin.templates(ScalaPlugin.scala:177)
at play.scalasupport.ScalaPlugin.update(ScalaPlugin.scala:195)
at play.scalasupport.ScalaPlugin.detectClassesChange(ScalaPlugin.scala:107)
at play.plugins.PluginCollection.detectClassesChange(PluginCollection.java:358)
at play.Play.detectChanges(Play.java:594)
at play.Invoker$Invocation.init(Invoker.java:186)
... 1 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,
scala-library-2.9.0-1.jar
被包含为 Neo4j 的依赖项...每次我运行
play dependency
时,它都会被下载到lib 文件夹,在我从文件夹中删除它后,它可以正常工作(到目前为止我只有用于启动和关闭数据库的代码)。it turns out that
scala-library-2.9.0-1.jar
is included as a dependency for neo4j...every time I run
play dependencies
it will be downloaded into the lib folder, after I delete it from the folder, it works without problem (so far I just have code for starting and shutting down of the DB).Cypher 查询语言依赖于 Scala。对于 1.5 版本,我们会将该依赖项更新为 2.9.1。
The Cypher Query language depends on Scala. We will update that dependency to 2.9.1 for the 1.5 release.