带有数据服务器插件的ESB 4.6.0 - 无法使用REF_CURSOR执行存储过程

时间:2013-02-15 02:10:58

标签: wso2 wso2esb wso2dss

我正在研究MAC OS X - 10.7.5,WSO2 ESB 4.6.0和数据服务功能 - 4.0.5

Java java版“1.6.0_37” Java(TM)SE运行时环境(版本1.6.0_37-b06-434-11M3909) Java HotSpot(TM)64位服务器VM(版本20.12-b01-434,混合模式)

我正在尝试使用ref cursor执行存储过程。

这是我的DS

<data name="RZM">
   <config id="RZS_Data">
      <property name="driverClassName">oracle.jdbc.driver.OracleDriver</property>
      <property name="url">XXXX</property>
      <property name="username">XXXX</property>
      <property name="password">XXXX</property>
      <property name="defaultTransactionIsolation">TRANSACTION_READ_COMMITTED</property>
   </config>
   <query id="TEST" useConfig="RZS_Data">
      <sql>call RT_PROC_GET_VERSION(:in_app_id,:in_version_id,?,?,?)</sql>
      <result element="Results" rowName="Result">
         <element column="app_url" name="app_url" optional="true" xsdType="string"/>
         <element column="out_message" name="OutMessage" optional="true" xsdType="string"/>
         <element column="out_err_message" name="out_err_message" optional="true" xsdType="string"/>
      </result>
      <param name="in_app_id" ordinal="1" sqlType="INTEGER" type="INOUT"/>
      <param name="in_version_id" ordinal="2" sqlType="STRING" type="INOUT"/>
      <param name="compare_from_id" ordinal="3" paramType="ARRAY" sqlType="ORACLE_REF_CURSOR" type="OUT"/>
      <param name="out_message" ordinal="4" sqlType="STRING" type="OUT"/>
      <param name="out_err_message" ordinal="5" sqlType="STRING" type="OUT"/>
   </query>
   <operation name="TOP">
      <call-query href="TEST">
         <with-param name="in_app_id" query-param="in_app_id"/>
         <with-param name="in_version_id" query-param="in_version_id"/>
      </call-query>
   </operation>
</data>

我一直在跟踪错误

[2013-02-14 18:00:14,400] ERROR - DataService DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: RZM
Location: /RZM.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: TOP
Current Params: {}

DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: RZM
Location: /RZM.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: TOP
Current Params: {}

    at org.wso2.carbon.dataservices.core.engine.CallQuery.extractParams(CallQuery.java:208)
    at org.wso2.carbon.dataservices.core.engine.CallQuery.executeElement(CallQuery.java:177)
    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.operation.Operation.execute(Operation.java:71)
    at org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:548)
    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:99)
    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110)
    at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562)
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:435)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:227)
    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.processEntityEnclosingRequest(ServerWorker.java:434)
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
[2013-02-14 18:00:14,402] ERROR - PassThroughHttpSender Failed to submit the response
org.apache.axis2.AxisFault: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: RZM
Location: /RZM.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: TOP
Current Params: {}

    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:435)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:227)
    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.processEntityEnclosingRequest(ServerWorker.java:434)
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: RZM
Location: /RZM.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: TOP
Current Params: {}

    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:105)
    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110)
    at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562)
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
    ... 12 more
[2013-02-14 18:00:14,403] ERROR - ServerWorker Error processing POST request for : /services/RZM.SOAP12Endpoint/TOP
org.apache.axis2.AxisFault: Failed to submit the response
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:496)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:229)
    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.processEntityEnclosingRequest(ServerWorker.java:434)
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
Caused by: org.apache.axis2.AxisFault: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: RZM
Location: /RZM.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: TOP
Current Params: {}

    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:435)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:227)
    ... 10 more
Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:in_version_id
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: RZM
Location: /RZM.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: TOP
Current Params: {}

    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:105)
    at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110)
    at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562)
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
    at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
    ... 12 more

我不确定为什么会收到此错误。我正在尝试使用“TryIt”服务执行DS。输入XML如下:

<body>
   <p:TOP xmlns:p="http://ws.wso2.org/dataservice">
      <!--Exactly 1 occurrence-->
      <p:in_app_id>1296</p:in_app_id>
      <!--Exactly 1 occurrence-->
      <p:in_version_id>2.2</p:in_version_id>
   </p:TOP>
</body>

存储过程定义从以下

开始
     create or replace procedure RT_PROC_GET_VERSION (in_app_id                in number,
                                                    in_version_id           in varchar2,
                                                    out_version_detail      out sys_refcursor,
                                                    out_message             out varchar2,
                                                    out_err_message         out varchar2)
    is
    begin
            open out_version_detail for
            select
                    app_url, switch_board_url, version
.
.

end RT_PROC_GET_VERSION;
你能帮帮忙吗? 谢谢 作者Abhijit

3 个答案:

答案 0 :(得分:2)

我也一直在和它斗争 我花了一些时间调试代码,并认为MessageContext中的请求原因是'null'。 因此,它导致Axis2传输配置影响了它。事实上,WSO2 ESB 4.6.0带有默认的传递http传输,它不会创建消息体,这就是为什么传递给服务的任何东西都不起作用的原因。 因此,为了使其工作,您需要在org.wso2.carbon.core.transports.http.HttpTransportListener中重新启用其他http传输(例如查找和取消注释repository/conf/axis2/axis2.xml) 这应该可以解决您禁用路径的问题。也许有办法在不同的端口上并排配置传输(稍后的任务)

一句话,通常你应该分别保留ESB和DSS作为解决不同的任务并需要特定的配置。

答案 1 :(得分:0)

阿济斯,

同时使用“命名参数”和“序数”(带数字的参数排序)会导致参数提取和赋值中的一些问题。我建议您统一使用“命名参数”选项或“序数”(两者中只有一个)来分配所有输入参数映射。这样可以解决问题。

希望这有帮助!

答案 2 :(得分:0)

尝试此调用RT_PROC_GET_VERSION(?,?,?,?,?)

在输入映射选项列表中,所有in和out参数都带有序号。 序数将基于问号。 有一点是上面查询中出现的问号应该与你存储的proc一样。 在存储过程之后,如果有任何数据将它们列在参数

例如:如果您的结果集带有id和地址,那么在输出映射中列出这两个。 注意:输入映射名称应与存储过程中的相同。