1
我正在使用Play! Framework版本2.1.5,QBox.io上的Jest 0.0.4和ElasticSearch 0.90.5。玩!框架和ElasticSearch StackOverflowError
我有下面的代碼位:
try {
SearchConfig config = new SearchConfig();
JestClient client = config.jestClient();
Logger.debug("client exists");
Index index = new Index.Builder(post).index("ads").type("ad").build();
Logger.debug("index exists");
client.execute(index);
Logger.debug("post client.execute()");
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
當我運行它使我有以下錯誤:
[debug] application - client exists
[debug] application - index exists
[debug] application - index: [email protected]
[error] application -
! @6fnicco9i - Internal server error, for (POST) [/user/posts] ->
play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.StackOverflowError]]
at play.api.Application$class.handleError(Application.scala:287) ~[play_2.10.jar:2.1.5]
at play.api.DefaultApplication.handleError(Application.scala:381) [play_2.10.jar:2.1.5]
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.5]
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.5]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.5]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.5]
java.lang.RuntimeException: java.lang.StackOverflowError
at play.libs.F$Promise$6.apply(F.java:401) ~[play_2.10.jar:2.1.5]
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]
java.lang.StackOverflowError: null
at com.google.gson.stream.JsonWriter.writeDeferredName(JsonWriter.java:401) ~[gson-2.2.3.jar:na]
at com.google.gson.stream.JsonWriter.value(JsonWriter.java:495) ~[gson-2.2.3.jar:na]
at com.google.gson.internal.bind.TypeAdapters$7.write(TypeAdapters.java:246) ~[gson-2.2.3.jar:na]
at com.google.gson.internal.bind.TypeAdapters$7.write(TypeAdapters.java:231) ~[gson-2.2.3.jar:na]
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) ~[gson-2.2.3.jar:na]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) ~[gson-2.2.3.jar:na]
[info] Compiling 1 Java source to /home/bcarlson/git/drillist/target/scala-2.10/classes...
[error] /home/bcarlson/git/drillist/app/controllers/Application.java:120: error: <identifier> expected
[error] Logger.debug("index: " + index.);
[error] ^
[error] 1 error
[error] (compile:compile) javac returned nonzero exit code
我是新來播放和ElasticSearch(和玩笑)我不知道如何解決這個SOError問題。任何幫助表示讚賞!提前致謝!
Ben
我無法使用Jest使用編組和解組工作。我最終只是返回對象ID並從它們構建一個對象數組。我會繼續研究這個,但我無法弄清楚。 –