-1

我有一个 GWT 应用程序,它可以在 GAE Google App Engine 本地运行良好。

在服务器端 RPC 服务中,我使用以下 json 类: http ://code.google.com/p/json-io/source/browse/src/main/java/com/cedarsoftware/util/io/JsonWriter.java

我在本地工作没有问题,但是在云中部署到 Google App Engine 时,我在这门课上得到了 Stackoverflow。

云中可能有任何本地没有发生的限制,因此它失败了?或者云中的谷歌应用引擎不支持以下任何类?

import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;

这是我在 appengine 日志中得到的堆栈跟踪:

javax.servlet.ServletContext log: Exception while dispatching incoming RPC call

java.lang.StackOverflowError
    at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:389)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:57)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:266)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:438)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
    at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.StackOverflowError
    at java.security.AccessController.doPrivileged(Native Method)
    at java.io.PrintWriter.<init>(PrintWriter.java:116)
    at java.io.PrintWriter.<init>(PrintWriter.java:100)
    at java.util.logging.SimpleFormatter.format(SimpleFormatter.java:155)
    at java.util.logging.StreamHandler.publish(StreamHandler.java:196)
    at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:105)
    at java.util.logging.Logger.log(Logger.java:530)
    at java.util.logging.Logger.doLog(Logger.java:551)
    at java.util.logging.Logger.log(Logger.java:640)
    at java.lang.reflect.Field.get(Field.java:30)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeObject(JsonWriter.java:1508)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeImpl(JsonWriter.java:636)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeObject(JsonWriter.java:1531)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeImpl(JsonWriter.java:636)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeCollectionElement(JsonWriter.java:1441)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeCollection(JsonWriter.java:980)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeImpl(JsonWriter.java:608)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeObject(JsonWriter.java:1531)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeObject(JsonWriter.java:1531)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeImpl(JsonWriter.java:636)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeObject(JsonWriter.java:1531)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeImpl(JsonWriter.java:636)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeCollectionElement(JsonWriter.java:1441)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeCollection(JsonWriter.java:980)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeImpl(JsonWriter.java:608)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeObject(JsonWriter.java:1531)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeImpl(JsonWriter.java:636)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeObject(JsonWriter.java:1531)
    at com.google.gwt.user.server.rpc.util.io.JsonWriter.writeImpl(JsonWriter.java:636)
[and so on...]
4

1 回答 1

0

似乎本地的递归循环结束了,因为堆栈大小足以解决操作,但在 gae 中它们更具限制性。

一个解决方案是改变你的对象复杂性,你可以把它贴在这里吗?

于 2013-04-24T15:38:25.067 回答