我有一个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。
云中是否存在本地未发生的任何限制,因此失败了?或者云中的Google应用引擎不支持以下任何类别?
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...]
答案 0 :(得分:0)
似乎本地的递归循环完成,因为堆栈大小足以解决操作,但是在更高的范围内它们更具限制性。
解决方案是改变对象的复杂性,是否可以在此处发布?