【问题标题】:AppEngine with Restlet handling requests, NullPointEerexception with DomRepresentation response带有 Restlet 处理请求的 AppEngine,带有 DomRepresentation 响应的 NullPointEerexception
【发布时间】:2010-01-30 18:34:46
【问题描述】:

部署我的 App Engine 应用并执行应该返回 XML 的 POST 请求后,我收到以下错误:

org.restlet.engine.http.HttpServerAdapter commit: An exception occured writing the response entity
java.io.IOException: Couldn't write the XML representation: java.lang.NullPointerException
    at org.restlet.ext.xml.DomRepresentation.write(DomRepresentation.java:275)
    at org.restlet.engine.http.HttpServerCall.writeResponseBody(HttpServerCall.java:510)

对本地运行的应用执行完全相同的请求不会导致任何错误。

【问题讨论】:

    标签: google-app-engine restlet


    【解决方案1】:

    也许您的本地数据库中有数据,在部署的版本中无法访问?如果不是,请提供更多背景信息(代码、库)。

    【讨论】:

    • 是的,抱歉,这是一个糟糕的问题,但我现在已经想通了。数据存储中的一些空数据未被选中。
    【解决方案2】:

    这是由于 GAE 的分块编码问题。现在在 Restlet 2.1 M3 中有一个解决方法。请参阅相关问题: Restlet POSTing JSON to Appengine error

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-30
      • 1970-01-01
      • 1970-01-01
      • 2013-03-25
      • 2016-12-07
      • 2019-10-16
      • 1970-01-01
      相关资源
      最近更新 更多