Error in getting json response from DSS server: “Error while writing to the output stream using JsonWriter”,“detail”:“”

帅比萌擦擦* 提交于 2019-12-10 20:27:30

问题


I'm getting following error while requesting json response from my dss service.

{"Fault":{"faultcode":"soapenv:Server","faultstring":"Error while writing to the output stream using JsonWriter","detail":""}}

curl request which i pass is

curl -X GET -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:9764/services/userdetails/test

I am getting the proper xml response if i remove accept header.

Strange thing is if i am running the same dss service from my colleague's laptop, i m getting the proper json response with that above curl command. Some configuration has changed in my pc because of that i'm getting this error in my pc.

I am not able to find what has changed in my pc because of which i'm getting this error.


回答1:


I also experienced the same recently. I was hoping to debug and find the cause, but didn't get a chance yet.

However, changing application/json formatter and sender implementations in respository/conf/axis2/axis2.xml resolved the issue. For that, you can uncomment/comment-out followings.

<messageFormatter contentType="application/json"
                  class="org.apache.axis2.json.JSONMessageFormatter"/>
<!--messageFormatter contentType="application/json"
                          class="org.apache.axis2.json.gson.JsonFormatter" /-->


<messageBuilder contentType="application/json"
                class="org.apache.axis2.json.JSONOMBuilder"/>
<!--messageBuilder contentType="application/json"
                        class="org.apache.axis2.json.gson.JsonBuilder" /-->

Hope this will help.



来源:https://stackoverflow.com/questions/24367280/error-in-getting-json-response-from-dss-server-error-while-writing-to-the-outp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!