gpt4 book ai didi

playframework - play2-elasticsearch示例不适用于play2.1.3

转载 作者:行者123 更新时间:2023-12-02 23:05:26 24 4
gpt4 key购买 nike

我正在尝试将play2-elasticsearch插件用于playframework2 2.1.3版
我刚按照github示例中的说明进行操作,唯一的修改是更改此行以在本地ip地址上使用服务器。

elasticsearch.client="127.0.0.1:9300"

但是当我尝试运行示例时,出现以下异常,任何想法吗?
我在Mac和JDK1.7上使用Play Framework 2.1.3
play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.ExceptionInInitializerError]]
at play.api.Application$class.handleError(Application.scala:289) ~[play_2.10.jar:2.1.3]
at play.api.DefaultApplication.handleError(Application.scala:383) ~[play_2.10.jar:2.1.3]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$play$core$server$netty$PlayDefaultUpstreamHandler$$handle$1$1.apply(PlayDefaultUpstreamHandler.scala:143) ~[play_2.10.jar:2.1.3]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$play$core$server$netty$PlayDefaultUpstreamHandler$$handle$1$1.apply(PlayDefaultUpstreamHandler.scala:139) ~[play_2.10.jar:2.1.3]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) ~[play_2.10.jar:2.1.3]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) ~[play_2.10.jar:2.1.3]
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at play.libs.F$Promise$6.apply(F.java:401) ~[play_2.10.jar:2.1.3]
at scala.concurrent.Future$$anonfun$map$1.liftedTree2$1(Future.scala:253) ~[scala-library.jar:na]
at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:249) ~[scala-library.jar:na]
at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:249) ~[scala-library.jar:na]
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29) ~[scala-library.jar:na]
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.liftedTree1$1(BatchingExecutor.scala:67) ~[akka-actor_2.10.jar:na]
Caused by: java.lang.ExceptionInInitializerError: null
at com.github.cleverage.elasticsearch.Index.getIndexPath(Index.java:36) ~[play2-elasticsearch-0.5.4.jar:0.5.4]
at com.github.cleverage.elasticsearch.Index$Finder.<init>(Index.java:97) ~[play2-elasticsearch-0.5.4.jar:0.5.4]
at indexing.IndexTest.<clinit>(IndexTest.java:20) ~[na:na]
at services.HashThat.index(HashThat.java:35) ~[na:na]
at controllers.PostApi.addComment(PostApi.java:96) ~[na:na]
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$20$$anonfun$apply$20.apply(routes_routing.scala:301) ~[na:na]
Caused by: java.lang.NullPointerException: null
at com.github.cleverage.elasticsearch.IndexService.<clinit>(IndexService.java:43) ~[play2-elasticsearch-0.5.4.jar:0.5.4]
at com.github.cleverage.elasticsearch.Index.getIndexPath(Index.java:36) ~[play2-elasticsearch-0.5.4.jar:0.5.4]
at com.github.cleverage.elasticsearch.Index$Finder.<init>(Index.java:97) ~[play2-elasticsearch-0.5.4.jar:0.5.4]
at indexing.IndexTest.<clinit>(IndexTest.java:20) ~[na:na]
at services.HashThat.index(HashThat.java:35) ~[na:na]
at controllers.PostApi.addComment(PostApi.java:96) ~[na:na]

最佳答案

从堆栈跟踪中,您似乎使用的是0.5.4版本,该版本与播放2.1.3不兼容(仅与播放2.1.0兼容)。

如果查看自述文件中的"versions" table,则将看到使用play 2.1.3时需要0.7-SNAPSHOT版本。尝试使用这个。

关于playframework - play2-elasticsearch示例不适用于play2.1.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18390483/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com