【问题标题】:Google App Engine- java.lang.IllegalStateException: Committed ErrorGoogle App Engine-java.lang.IllegalStateException:提交错误
【发布时间】:2010-11-12 09:00:46
【问题描述】:

我目前正在开发一个需要我部署到 Google App Engine 服务器上的应用程序。我的应用程序在本地端口 7777 上运行良好。但是,当我部署到 GAE 时,它开始给我这个错误 -

java.lang.IllegalStateException: Committed 

它只是在 GAE 日志中返回一个“null”。

没有错误。它只声明一条警告消息:

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)

希望有人可以帮助我。提前致谢!

【问题讨论】:

  • 您没有针对 IllegalStateException 或 null/NullPointerException 的完整堆栈跟踪。

标签: java google-app-engine


【解决方案1】:

这个java.lang.IllegalStateException: Committed 错误经常发生在HttpServletResponse 被提交两次时。例如:

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

【讨论】:

    【解决方案2】:

    在解析 servlet 时,不知何故有 2 个 sendRedirect() 会导致问题。 尝试修改逻辑以在您的代码中只有一个 sendRedirect() 。我在本地码头服务器上遇到了类似的情况。 GAE 在码头运行!

    【讨论】:

      猜你喜欢
      • 2012-01-25
      • 1970-01-01
      • 1970-01-01
      • 2011-08-11
      • 2010-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-17
      相关资源
      最近更新 更多