开发者

Google App Engine- java.lang.IllegalStateException: Committed Error

I'm currently working on an application that require me to deploy onto Google App Engine Server. My application runs perfectly fine locally on port 7777. However, when I deploy onto GAE, It starts to give me this error -

java.lang.IllegalStateException: Committed 

and it just returns me a "null" in the GAE log.

There's no error. It only state a warning mess开发者_C百科age:

"A serious problem was encountered with the process that handled this request, causing it to exit. This is likely to cause a new process to be used for the next request to your application. If you see this message frequently, you may be throwing exceptions during the initialization of your application. (Error code 104)"

Hope someone can help me with this. Thanks in advance!


This java.lang.IllegalStateException: Committed error often occurs when the HttpServletResponse is commited twice. For example :

protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    if (trueCondition)
        resp.sendRedirect("/");
    if (otherTrueCondition)
        resp.sendRedirect("/other");
}


somehow having 2 sendRedirect() is causing the problem when the servlet is parsed. try to modify the logic to have only one sendRedirect() in your code. I had a similar situation with a local jetty server. GAE runs in jetty!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜