简体   繁体   English

错误 - 无法转换,不是 json 字符串:[类型:INPUT_STREAM,值:空手道框架中的 java.io.BufferedInputStream@5f8890c2

[英]Error - cannot convert, not a json string: [type: INPUT_STREAM, value: java.io.BufferedInputStream@5f8890c2 in karate framework

In karate framework, while executing one test case, getting error在空手道框架中,在执行一个测试用例时,出现错误

java.lang.RuntimeException: cannot convert, not a json string: [type: INPUT_STREAM, value: java.io.BufferedInputStream@5f8890c2] at com.intuit.karate.Script.toJsonDoc(Script.java:619) at com.intuit.karate.Script.assign(Script.java:586) at com.intuit.karate.Script.assignJson(Script.java:543) at com.intuit.karate.StepDefs.castToJson(StepDefs.java:329) at ✽.* json vExpectedJSONObject = vExpectedJSONFileContent, java.lang.RuntimeException:无法转换,不是 json 字符串:[类型:INPUT_STREAM,值:java.io.BufferedInputStream@5f8890c2] 在 com.intuit.karate.Script.toJsonDoc(Script.java:619) 在 com.intuit .karate.Script.assign(Script.java:586) at com.intuit.karate.Script.assignJson(Script.java:543) at com.intuit.karate.StepDefs.castToJson(StepDefs.java:329) at ✽。 * json vExpectedJSONObject = vExpectedJSONFileContent,

Acually in this framework, we are executing sql query and then result of that query is stored at abc.json file.实际上在这个框架中,我们正在执行 sql 查询,然后该查询的结果存储在 abc.json 文件中。 but due to this error that result is not getting stored in that json file.但由于此错误,结果未存储在该 json 文件中。

I have tired with multiple option like file incoding - set to utf-8 then adding plugin in to pom.xml.我厌倦了多个选项,例如文件编码 - 设置为 utf-8 然后将插件添加到 pom.xml。

json vExpectedJSONObject = vExpectedJSONFileContent, I am expecting the sql result should be stored in json file. json vExpectedJSONObject = vExpectedJSONFileContent,我期望 sql 结果应该存储在 json 文件中。

Finally got the solution:), Issue was related to framework setup, actually we are trying to call Runtime.getRuntime().exec funtion to execute our sql query by using command at cmd prompt.终于得到了解决方案:),问题与框架设置有关,实际上我们正在尝试调用 Runtime.getRuntime().exec 函数来通过在 cmd 提示符下使用命令来执行我们的 sql 查询。 but due to some access privileges that command was not executing, so after debug, we have put that mysql.exe file into jre/bin folder and then it works....但是由于该命令没有执行的某些访问权限,因此在调试后,我们将该 mysql.exe 文件放入 jre/bin 文件夹中,然后它就可以工作了....

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将“(String, JSON)”类型的值转换为预期的参数类型“[JSONSubscriptType]” - Cannot convert value of type '(String, JSON)' to expected argument type '[JSONSubscriptType]' Json错误:无法将类型java.lang.String的值sl_summ转换为JSON OBJECT - Json Error: Value sl_summ of type java.lang.String cannot be converted to JSON OBJECT 解析json数据时出错(java.lang.String类型的值无法转换为json数组) - error parsing json data (value of type java.lang.String cannot be converted to json array) org.json.JSONException:无法将 java.lang.String 类型的值 java.io.IOException 转换为 JSONArray - org.json.JSONException: Value java.io.IOException of type java.lang.String cannot be converted to JSONArray JSON org.json.JSONException:类型为java.lang.String的值错误无法转换为JSONObject - JSON org.json.JSONException: Value Error of type java.lang.String cannot be converted to JSONObject 解析dataorg.json.JSONException:值时出错 - Error parsing dataorg.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject 错误:org.json.JSONEXception:类型为java.lang.String的值访问无法转换为JSONObject - error: org.json.JSONEXception: Value Access of type java.lang.String cannot be converted to JSONObject Blogger JSON API错误:值非java.lang.String类型的值无法转换为JSONObject - Blogger JSON API Error: Value Not of type java.lang.String cannot be converted to JSONObject android中的JSON错误“无法将类型为java.lang.String类型的结果值转换为JSONArray” - JSON error “Value at result of type java.lang.String cannot be converted to JSONArray” in android 解析数据org.json.JSONException时出错:类型java.lang.String的值无法转换为JSONArray - Error Parsing Data org.json.JSONException: Value of type java.lang.String cannot be converted to JSONArray
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM