gpt4 book ai didi

java - 玩!框架和 ElasticSearch StackOverflowError

转载 作者:行者123 更新时间:2023-12-01 04:19:06 25 4
gpt4 key购买 nike

我正在使用 Play!框架版本 2.1.5,QBox.io 上有 Jest 0.0.4 和 ElasticSearch 0.90.5。

我有以下代码:

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: io.searchbox.core.Index@2ddf188f
[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

我是 Play 和 ElasticSearch(以及 Jest)的新手,我不知道如何解决这个 SOError。任何帮助表示赞赏!预先感谢!

-本

最佳答案

增加应用程序的堆栈大小没有帮助?

可以使用 jvm 选项 -Xss4m 来完成,其中 4m 比操作系统上的默认值更大。

关于java - 玩!框架和 ElasticSearch StackOverflowError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19149814/

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