WSO2 EI 6.4.0调用DSS REST资源报EPR找不到操作错误求助
WSO2 EI 6.4.0调用DSS执行TRUNCATE语句报错问题
场景说明
在WSO2 EI 6.4.0中调用WSO2 DSS执行TRUNCATE语句清空表数据,调用时报错。曾尝试使用DBReport Mediator,但删除2条记录耗时超6分钟,因此改用DSS方案。
WSO2 DSS配置代码
<data name="WSO2_ZCloud_test_DSS" transports="http https local"> <config enableOData="false" id="Test_DataSource"> <property name="driverClassName">org.postgresql.Driver</property> <property name="url">jdbc:postgresql://hostname:5432/db_schema</property> <property name="username">user</property> <property name="password">password</property> </config> <query id="dev_truncate_Q" useConfig="Test_DataSource"> <sql>TRUNCATE TABLE test_db.dev_test</sql> </query> <resource method="GET" path="dev_env_truncate"> <call-query href="dev_truncate_Q"/> </resource> </data>
EI调度任务调用的序列配置
<sequence name="testBQ" xmlns="http://ws.apache.org/ns/synapse"> <log level="custom"> <property name="*********testBQ: B4 Truncate" value="**********"/> </log> <call> <endpoint> <http method="GET" uri-template="http://localhost:8280/devcontainer/services/WSO2_ZCloud_test_DSS/dev_env_truncate"> <timeout> <duration>60000</duration> </timeout> <suspendOnFailure> <errorCodes>-1</errorCodes> <initialDuration>0</initialDuration> <progressionFactor>1.0</progressionFactor> <maximumDuration>0</maximumDuration> </suspendOnFailure> </http> </endpoint> </call> <log level="custom"> <property name="*********after Truncate" value=" **********"/> </log> </sequence>
报错信息
异常提示
ERROR {org.apache.axis2.engine.AxisEngine} - The endpoint reference (EPR) for the Operation not found is /devcontainer/services/WSO2_ZCloud_test_DSS/dev_env_truncate and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.
完整错误日志
[2023-03-21 09:42:39,470] [-1234] [] [PassThroughMessageProcessor-93] ERROR {org.apache.axis2.engine.AxisEngine} - The endpoint reference (EPR) for the Operation not found is /devcontainer/services/WSO2_ZCloud_test_DSS/dev_env_truncate and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator. org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is /devcontainer/services/WSO2_ZCloud_test_DSS/dev_env_truncate and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator. at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102) at org.apache.axis2.engine.Phase.invoke(Phase.java:329) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167) 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) [2023-03-21 09:42:39,470] [-1234] [] [PassThroughMessageProcessor-93] ERROR {org.apache.synapse.transport.passthru.ServerWorker} - Error processing GET request for : /devcontainer/services/WSO2_ZCloud_test_DSS/device_inventory_truncate org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is /devcontainer/services/WSO2_ZCloud_test_DSS/dev_env_truncate and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator. at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102) at org.apache.axis2.engine.Phase.invoke(Phase.java:329) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
已排查情况
- 该REST资源操作未在DSS的TryIt工具中显示
- 已查阅大量同类问题并尝试多种方法,未解决
解决建议
验证DSS服务部署与路径正确性
- 登录DSS的Carbon控制台,确认
WSO2_ZCloud_test_DSS服务状态为活跃,无启动报错 - 核对调用URL:DSS服务的默认访问路径为
http://<DSS_HOST>:<DSS_PORT>/services/WSO2_ZCloud_test_DSS/dev_env_truncate,注意EI与DSS的端口差异(DSS默认9763/9443,EI默认8280/8243),若跨实例调用需确保网络连通
- 登录DSS的Carbon控制台,确认
修改DSS资源配置,添加响应处理
TRUNCATE语句无返回结果,需为DSS资源显式定义响应内容,避免空响应导致的调度错误:<resource method="GET" path="dev_env_truncate"> <call-query href="dev_truncate_Q"/> <response> <payloadFactory media-type="json"> <format>{"status":"success","message":"Table truncated successfully"}</format> <args/> </payloadFactory> </response> </resource>优化EI调用的Endpoint配置
- 若DSS与EI部署在同一服务器,使用本地传输提升性能并避免网络问题:
<endpoint> <http method="GET" uri-template="local://services/WSO2_ZCloud_test_DSS/dev_env_truncate"> <!-- 保留原超时、失败挂起配置 --> </http> </endpoint> - 添加Accept请求头,明确响应类型:
<call> <header name="Accept" value="application/json"/> <endpoint> <!-- 原Endpoint配置 --> </endpoint> </call>
- 若DSS与EI部署在同一服务器,使用本地传输提升性能并避免网络问题:
检查DSS的REST传输配置
确认DSS的axis2.xml中已启用HTTP传输,存在如下配置:<transportReceiver name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpListener"> <parameter name="port">9763</parameter> <!-- 其他参数 --> </transportReceiver>重新部署DSS服务
清理DSS临时目录(<DSS_HOME>/tmp、<DSS_HOME>/work),重新打包部署服务,确保配置生效
内容的提问来源于stack exchange,提问作者Justin
相关产品推荐
相关产品推荐

