WSO2 ESB 4.9-发送介体导致错误 [英] WSO2 ESB 4.9 - Send mediator causing errors

查看:121
本文介绍了WSO2 ESB 4.9-发送介体导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近几天我一直在处理资源(我对WSO2还是很陌生,所以我仍然很慢),当我通过SoapUI向它提交请求时,它会记录所有应该记录的信息<send/>中介程序,然后转储以下错误:

I've been working on a resource over the last few days (I'm very new to WSO2 so I'm still pretty slow) and when I submit a request to it via SoapUI, it logs everything it should up to the <send/> mediator and then dumps the following errors:

ERROR -  Failed to submit the response {org.apache.synapse.transport.passthru.PassThroughHttpSender}
java.lang.NullPointerException
	at org.apache.synapse.transport.passthru.util.SourceResponseFactory.create(SourceResponseFactory.java:64)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:462)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:267)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
	at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:444)
	at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:102)
	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:277)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:679)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:244)
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:529)
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
	at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247)
	at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

[2015-12-10 13:11:00,508] ERROR -  Access-Control-Allow-Credentials:true,Cache-Control:no-cache,Content-Type:application/json,Etag:W/"2-mZFLkyvTelC5g8XnyQrpOw",Expires:-1,Pragma:no-cache,Vary:Origin, X-HTTP-Method-Override,Via:1.1 vegur,X-Content-Type-Options:nosniff,X-Powered-By:Express,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><jsonObject><TYPE></TYPE><NODE></NODE><STATUS>200 [OK]</STATUS></jsonObject></soapenv:Body></soapenv:Envelope> Unexpected error sending message back {org.apache.synapse.core.axis2.Axis2Sender}
org.apache.axis2.AxisFault: Failed to submit the response
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:610)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:269)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
	at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:444)
	at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:102)
	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:277)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:679)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:244)
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:529)
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
	at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247)
	at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.apache.synapse.transport.passthru.util.SourceResponseFactory.create(SourceResponseFactory.java:64)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:462)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:267)
	... 16 more

该资源从SoapUI接收JSON提交,如下所示:

The resource takes in a JSON submission from SoapUI, like the one below:

{"tests":[{"type":"DSS","node":"2"}]}

从提交的内容中,得出要测试的系统(DSS)的类型以及该系统上要测试的节点(2).在这种情况下,它将运行以下序列,以测试我们正在运行的DSS上的节点2:

From that submission, it draws the type of system to test (DSS) and which node on that system to test (2). In this case, it runs the sequence below, in order to test node 2 on the DSS we're running:

<sequence name="dss_node_2_seq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
  <log level="custom">
    <property name="[[ SQNC ]]" value="STARTING DSS2 SEQUENCE"/>
  </log>
  <call>
    <endpoint key="dss_node_2"/>
  </call>
</sequence>

此序列显然会调用dss_node_2端点,此端点目前指向带有一些模板化有效JSON的Typicode页面:

This sequence obviously then calls the dss_node_2 endpoint which at the moment points to a typicode page with some templated valid JSON:

<endpoint name="dss_node_2" xmlns="http://ws.apache.org/ns/synapse">
  <http method="post" trace="disable" uri-template="http://jsonplaceholder.typicode.com/posts/1"/>
</endpoint>

我已将资源放入 Kobra.io页面中,因此您可以看到它并进行必要的更改.目前,我目前仅在DSS上对其进行测试,但是有几种可能的类型,每种类型都有一定数量的节点.

I have put the resource into a Kobra.io page so you can see it and make any changes that are necessary. I'm currently testing it on just DSS at the moment but there are several types that are possible, each with a set number of nodes.


如果有人可以建议为什么将这些错误扔给我以及如何解决,那将是非常有帮助的,并且非常感激,因为我已经在这个问题上待了好几个小时了,这实在令人无奈!!

If anyone could suggest why it's throwing these errors at me and how to fix it, that'd be really helpful and much appreciated as I've been stuck on this for hours now and it's becoming quite the frustration!

推荐答案

尝试使用 发送 中介程序而不是调用中介程序,它将等待整个流程完成,发送可以帮助您立即发送回复.

Try using send Mediator instead of call mediator ,Which will wait for the entire flow to complete, send may help you to send the response immediately.

 <send>
<endpoint key="dss_node_2"/>
</send>  

这篇关于WSO2 ESB 4.9-发送介体导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆