简体   繁体   English

使用Scala配置Play框架以使用Neo4j图形数据库

[英]configuring Play framework with Scala to use Neo4j graph db

I'm using scala in my app, it run without problem, but if I add neo4j in the dependencies, it throws a NoSuchMethod error. 我在我的应用程序中使用scala,它运行没有问题,但如果我在依赖项中添加neo4j,它会抛出NoSuchMethod错误。 I didn't even have references to any neo4j classes in my code... 我甚至没有在我的代码中引用任何neo4j类...

I have no problem using play framework with scala, or play framework (Java) with neo4j, just when using both together, it crash... 我没有问题使用scala的play框架,或者使用neo4j玩框架(Java),就在同时使用它们时,它会崩溃...

and I tried both neo4j 1.4.2 and 1.5.M02 to no avail. 我试过neo4j 1.4.2和1.5.M02都无济于事。

thanks for any help~ 谢谢你的帮助〜

Chris 克里斯

dependencies.yml 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

it turns out that scala-library-2.9.0-1.jar is included as a dependency for neo4j... 事实证明, scala-library-2.9.0-1.jar作为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). 每次我运行play dependencies它都会被下载到lib文件夹中,在我从文件夹中删除后,它可以正常工作(到目前为止我只有启动和关闭数据库的代码)。

The Cypher Query language depends on Scala. Cypher查询语言依赖于Scala。 We will update that dependency to 2.9.1 for the 1.5 release. 我们将1.5版本的依赖关系更新为2.9.1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM