WSO2 EI: Dataservice using giving INCOMPATIBLE_PARAMETERS_ERROR when calling through REST API

匆匆过客 提交于 2021-01-28 19:57:26

问题


I am using WSO2 EI 6.3.0 version. I am creating data service within the application which reads data from CSV. I am running into very unusual case where I have created two data services. One with sample Product.csv which is shipped with WSO2 EI. When calling Sample (Product.CSV) I am able to get the json response message. but when I am trying to invoke another API which other data service it is giving me below error:

[2018-10-10 17:57:31,916] [EI-Core] ERROR - JsonStreamFormatter Error occurred while writing to application/json
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor133.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.wso2.carbon.integrator.core.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:107)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:597)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:281)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:158)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in     CSVQuery.runQuery.
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: InvoiceReport
Location: /InvoiceReport.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: _getinvoice
Current Params: {}
Nested Exception:-
DS Fault Message: Error in 'StaticOutputElement.execute', cannot find   parameter with type:column name:Docnumber
DS Code: INCOMPATIBLE_PARAMETERS_ERROR

Below is Data service:

<data name="InvoiceReport" transports="http https local">
<config enableOData="false" id="CSV_InvoiceReport">
<property name="csv_datasource">/usr/lib/wso2/wso2ei/6.3.0/samples/data-services/resources/Invoice.csv</property>
<property name="csv_columnseperator">comma</property>
<property name="csv_startingrow">2</property>
<property name="csv_hasheader">true</property>
<property name="csv_headerrow">1</property>

</config>
<query id="Q2" useConfig="CSV_InvoiceReport">
  <result outputType="json">{&#xd; "Products": {&#xd; "Product": [&#xd; {&#xd; "Docnumber":"$Docnumber",&#xd; "Invoicenumber":"$Invoicenumber",&#xd; "Documentdate":"$Documentdate",&#xd; "Invoiceduedate":"$Invoiceduedate",&#xd; "Customerid":"$Customerid",&#xd; "Documenttotal":"$Documenttotal",&#xd; "Quantity":"$Quantity",&#xd; "Unitprice":"$Unitprice",&#xd; "Extendedprice":"$Extendedprice",&#xd; "Consumer":"$Consumer",&#xd; "Servicename":"$Servicename"&#xd;&#xd; }&#xd; ]&#xd; }&#xd;}&#xd;</result>
</query>
<operation name="GetInvoiceReport">
  <call-query href="Q2"/>
</operation>
<resource method="GET" path="Invoice">
  <call-query href="Q2"/>
</resource>
</data>

Not sure where is the problem. Both are simple data service and didnot find any differences in creating them. One is working and one is not working at all.

Can some one please help me. Is this a bug?

Thanks in advance.

来源:https://stackoverflow.com/questions/52746293/wso2-ei-dataservice-using-giving-incompatible-parameters-error-when-calling-thr

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