gpt4 book ai didi

java - WSO2 DSS 错误 : javax. xml.stream.XMLStreamException:无效的 Staring 元素

转载 作者:行者123 更新时间:2023-11-30 06:17:57 28 4
gpt4 key购买 nike

我是 WSO2 DSS 和 REST 架构的新手,我正在测试使用 Microsoft SQL Server 数据源使用 DSS 创建的服务。我在下面创建了一个查询,它将获取员工信息

SELECT e.employee_id[Employee_Id],
e.employee_code[Employee_Code],
e.name_eng[Employee_Name_Eng],
e.name_arb[Employee_Name_Arb],
o.description_arb[Organization_Unit_Arb],
o.description_eng[Organization_Unit_Eng],
g.description_arb[Grade_Arb],
g.description_eng[Grade_Eng],
d.description_arb[Designation_Arb],
d.description_eng[Designation_Eng],
e.email[Email],
r.role_name[Role]
FROM employee_master e
LEFT OUTER JOIN organizations o
ON o.organization_id = e.organization_id
LEFT OUTER JOIN grades g
ON g.grade_id = e.grade_id
LEFT OUTER JOIN designations d
ON d.designation_id = e.designation_id
LEFT OUTER JOIN sec_users u
ON e.employee_id = u.employee_id
LEFT OUTER JOIN sec_user_roles ur
ON ur.user_id = u.user_id,
LEFT OUTER JOIN sec_roles r
ON ur.role_id = r.role_id
WHERE r.role_id =
(SELECT MAX(role_id) FROM sec_user_roles WHERE user_id = u.user_id)
AND u.login = ?

并分配给资源用户/{login}。但是我总是遇到错误

[ec2-user@ip-172-31-37-209 ~]$ curl -i -H "Accept: application/json" -X GET http://54.76.120.61:9764/services/FTE/user/103
HTTP/1.1 500 Internal Server Error
Transfer-Encoding: chunked
Date: Tue, 19 Aug 2014 07:42:31 GMT
Connection: close
Server: WSO2 Carbon Server

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

查询运行良好,我已经创建了类似的测试,其中简单的 get 将返回 JSON 格式的结果。检查日志后,它有一个错误说

Caused by: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: FTE
Location: /FTE.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: _getuser_login
Current Params: {login=103}
Nested Exception:-
DS Fault Message: Error in XML generation at StaticOutputElement.execute
DS Code: UNKNOWN_ERROR
Nested Exception:-
javax.xml.stream.XMLStreamException: Invalid Staring element


at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processNormalQuery(SQLQuery.java:864)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.runQuery(SQLQuery.java:2290)
at org.wso2.carbon.dataservices.core.description.query.Query.execute(Query.java:282)
at org.wso2.carbon.dataservices.core.engine.CallQuery.executeElement(CallQuery.java:179)
at org.wso2.carbon.dataservices.core.engine.CallQueryGroup.executeElement(CallQueryGroup.java:111)
at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
at org.wso2.carbon.dataservices.core.description.resource.Resource.execute(Resource.java:67)
at org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:462)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:96)
... 46 more
Caused by: DS Fault Message: Error in XML generation at StaticOutputElement.execute
DS Code: UNKNOWN_ERROR
Nested Exception:-
javax.xml.stream.XMLStreamException: Invalid Staring element

at org.wso2.carbon.dataservices.core.engine.StaticOutputElement.executeElement(StaticOutputElement.java:258)
at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
at org.wso2.carbon.dataservices.core.engine.OutputElementGroup.executeElement(OutputElementGroup.java:106)
at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
at org.wso2.carbon.dataservices.core.description.query.Query.writeResultEntry(Query.java:396)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processNormalQuery(SQLQuery.java:857)
... 54 more
Caused by: javax.xml.stream.XMLStreamException: Invalid Staring element
at org.apache.axis2.json.gson.GsonXMLStreamWriter.writeStartElement(GsonXMLStreamWriter.java:239)
at org.wso2.carbon.dataservices.core.engine.XMLWriterHelper.writeResultElement(XMLWriterHelper.java:144)
at org.wso2.carbon.dataservices.core.engine.StaticOutputElement.executeElement(StaticOutputElement.java:250)
... 59 more

不幸的是,我无法理解错误,搜索网络会产生我不太熟悉的不同答案。我希望有人可以启发我,因为我只做了 2 个月。

非常感谢。

最佳答案

作为补充信息,Escaping non printable characters 可以在 DSS 的定义中找到。

对于手动编辑 DSS 的人,您可以像这样将属性 escapeNonPrintableChar 添加到标记结果中

<result element="MyList" rowName="myRow" escapeNonPrintableChar="true">

关于java - WSO2 DSS 错误 : javax. xml.stream.XMLStreamException:无效的 Staring 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25378455/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com