2010-11-12 98 views
3

我目前正在研究一個需要我部署到Google App Engine Server的應用程序。我的應用程序運行完全正常的本地端口7777。然而,當我部署到GAE,它開始給我這個錯誤 -Google App Engine- java.lang.IllegalStateException:提交錯誤

java.lang.IllegalStateException: Committed 

,它只是返回我一個「空」在GAE日誌。

沒有錯誤。它只是說明一個警告消息:

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)

希望有人能幫助我與此有關。提前致謝!

+0

難道你沒有一個完整的堆棧跟蹤IllegalStateException或null/NullPointerException。 – crowne 2010-11-12 10:28:41

回答

5

這個java.lang.IllegalStateException: Committed錯誤經常發生在HttpServletResponse被提交兩次。例如:

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

不知何故有2個sendRedirect()在解析servlet時導致問題。 嘗試修改邏輯在代碼中只有一個sendRedirect()。我與當地的碼頭服務器有類似的情況。 GAE在碼頭運行!