title: Google App Engine restrictions with java.io?
body: <p>I have a GWT app, which runs fine locally with GAE Google App Engine.</p>
  
  <p>Inside a serverside RPC service I use the following json class:
  <a href="http://code.google.com/p/json-io/source/browse/src/main/java/com/cedarsoftware/util/io/JsonWriter.java" rel="nofollow">http://code.google.com/p/json-io/source/browse/src/main/java/com/cedarsoftware/util/io/JsonWriter.java</a></p>
  
  <p>I works locally without problems, but when deploying to Google App Engine in the cloud, I'm getting a Stackoverflow right in this class.</p>
  
  <p>May there be any limitations in the cloud that did not occur locally, and thus it fails? Or are any of the following classes not supported by google app engine in the cloud?</p>
  
  <pre><code>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;
  </code></pre>
  
  <p>This is the stacktrace I get in appengine logs:</p>
  
  <pre><code>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.&lt;init&gt;(PrintWriter.java:116)
      at java.io.PrintWriter.&lt;init&gt;(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...]
  </code></pre>