我尝试解析一个巨大的 json 文件,它超过 524288 个字符,我无法用 groovy 解析它并且没有异常文本。这是一个已知问题,是否有任何解决方法?
可以是tomcat的限制吗?
更新:
我有一个异常(exception):
ERROR (org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver) - JSONException occurred when processing request: [POST] /person/parsePersonJson
Expected a ',' or ']' at character 524288 of ...
更新 2:
在我使用的 grails 中:
JSON.parse(params.myJson)
更改
maxPostSize
的 tomcat 设置至 "0"
最佳答案
它可能与 Tomcat 中配置的 POST 参数大小的值(maxPostSize)有关。您应该引用以下文档:http://tomcat.apache.org/tomcat-5.5-doc/config/http.html (关键字:“maxPostSize
”)以获得更多解释。然后,您可以尝试增加该值。希望这可以帮助!
关于grails - Json字符串超过524288异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24231103/