Unknown localEntry mediator in WSO2ESB - wso2

I am getting this error when using localEntry mediator in WSO2ESB 5.0.0:
org.apache.axis2.AxisFault: Unknown mediator referenced by configuration element : {http://ws.apache.org/ns/synapse}localEntry
Does this mediator exist? According to this documentation it does.

Local Entry is not a mediator. Its task is to store information. The way you're using it must be wrong.

Related

WSO2 ESB 5.0.0 Datamapper error is not launching fault sequence

I'm trying to use datamapper for transforming the incoming message, the problem is, when the message is different from expected it literally ends up the execution without calling the fault sequence that I've defined for the sequence. Is there a solution for this? How can I deal with mapping errors?
Thanks,
Tony
DataMapper mediator as of now does not perform a validation against the schema. When the mapping cannot be performed due to incompatible input, the execution fails. Since you have an XML payload, you can use a Validate mediator before the DataMapper to verify that the payload adheres to the expected XML schema. Refer https://docs.wso2.com/display/ESB490/Validate+Mediator for more details. By specifying the fault path in Validate mediator, you can solve your mentioned problem.

WSO2 ESB store and forward - Unexpected error during sending message out

Having WSO2 5.0.0 trying to implement the store and forward pattern with a JDBC message store.
Sending a message to the target endpoint throws an exception:
TID: [-1234] [] [2016-12-05 23:25:24,874] ERROR {org.apache.synapse.message.processor.impl.sampler.SamplingService} - Error occurred while executing the message {org.apache.synapse.message.processor.impl.sampler.SamplingService}
org.apache.synapse.SynapseException: Unexpected error during sending message out
at org.apache.synapse.core.axis2.Axis2Sender.handleException(Axis2Sender.java:257)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:84)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:548)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:382)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:65)
at org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:55)
at org.apache.synapse.mediators.builtin.CallMediator.handleNonBlockingCall(CallMediator.java:221)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:99)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.message.processor.impl.sampler.SamplingService$1.run(SamplingService.java:211)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:538)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:78)
... 15 more
I believe I am missing an important transport, Axis2 or Synapse property, but I am unable to find which one.
Sequences to store and forward are here.
I was trying to find out in the source codes what could be causing the NullPointerException, but for me it makes no sense as the httpMethod and messageType is defined.
Thank you all for any hint
Edit:
based on a comment, the Synapse source in use is here.
Where is your Message Processor here? Ideally your Message Processor should call the backend service using the call mediator. Can you please try out the steps as below.
Create a proxy service to accept messages and store them in your JDBC store using the store mediator inside that.
Then create a Scheduled Message Forwarding Processor which listens to the above JDBC store and forwards messages to the endpoint. If you need you can specify any reply sequence. Otherwise make sure you set following property inside your proxy service above. <property name="OUT_ONLY" value="true" />
If you still can not figure out the error get the wire logs by enabling the log4j.logger.httpclient.wire.header=DEBUG
log4j.logger.httpclient.wire.content=DEBUG in log4j.properties file and post it here so that I can analyze and help you out.
If you need guaranteed delivery, you have to use the Message Forwarding processor. Sampling processor is used to implement throttling related usecases which may lead to message loss.
For more information please refer the article [1]. Don't use the same synapse configuration since it is bit obsoleted, instead create artifacts using ESB web interface or developer studio. Otherwise you may run into different errors due to missing configurations.
[1] http://wso2.com/library/articles/2014/01/guaranteed-delivery-with-Message-Store-Message-Processor%20/

WSO2 ESB. Differences between v. 5.0.0 and v. 4.9.0. Send mediator

In WSO2 ESB v. 4.9.0 send metiator did not terminate sequence where it is and all parent sequences and at last proxy service or API. So, in code :
...
<!-- This seqience has send mediator -->
<sequence key="ElabaFtpFileWrite"/>
<!-- This sequence has send mediator -->
<sequence key="ElabaSendMail"/>
<!-- for instance, some mediator or another logic -->
<log level="full"/>
...
second sequence and log mediator are always performed.
On the contrary, in version 5.0.0. nether second sequence nor log mediator are performed.
According to the documentation about send mediator of v. 5.0.0 second behavior is right. But why in v. 4.9.0 send worked in different way and I didn't find any notice about such issue.
I think I somehow did not notice because I am not very experienced user of WSO2 products.
I changed send mediator to call mediator in first and second sequences and then log mediator is performed.
Is such resolution right?
See https://github.com/wso2/wso2-synapse/commit/dc78d18210f3cbd8d2eb04bcd7236658ee3731f4 : on Jun 29, 2016, send mediator has been changed to return "false" (instead of "true") to avoid remaining mediators to be executed
The documentation reflect this : compare https://docs.wso2.com/display/ESB490/Send+Mediator and https://docs.wso2.com/display/ESB500/Send+Mediator you will notice this add-on :
Do not add any mediator configurations after Send mediator in the same sequence, because WSO2 ESB does not process them. Any mediator configuration after the Send mediator should go to the outSequence or receive sequence.

wso2 using clone and aggregate with datamapper

So I am using Clone Mediator and Aggregate Mediator to get the two(2) response from the API in a single request. But the problem is that the first request returns an error from DataMapper Mediator (http://pastebin.com/7P43ZbAa) and the second request returned my expected response (http://pastebin.com/2WbCvi9z) without any errors.
Here's my api config
http://pastebin.com/2ytGEkFk

How to populate SOAP headers like From, ReplyTo in ESB 4.0.3

We are using WSO2 ESB 4.0.3 with Data services feature on MAC OSX 10.7.4.
I have proxy service which forwards the message to Data Service. When there is any fault in Data service the fault is returned to calling proxy service in OUTSEQUENCE. Now if there is any error I forward this to common error handler from proxy service which happens in OUTSEQUENCE. This common error handler is another proxy service only.
Now when the Error handling is completed the control returns back to original proxy service which called the error handling proxy service. But what happens is when the control returns to original proxy service from error handler it AGAIN starts executing the OUTSEQUENCE of proxy service.
So for me it is executing the OUTSEQUENCE of proxy service twice in case of fault from Data Service.
Is it standard behavior? I used to Java kind of executing where when the call from method returns it starts executing the next line. But here looks like it again starts executing the OUTSEQUENCE from beginning.
To avert executing the OUTSEQUENCE from beginning again I populate the value at "transport" scope in Error hanlder proxy which will used in filter mediator to avoid executing the logic in OUTSEQUENCE twice.
I am trying to find if there are any SOAP headers I can use instead of setting the property. I see no SOAP headers being set like "From" or "ReplyTo" and I believe message co-ordination happens with MessageId. How can we use these SOAP headers instead of property to divert the flow logic.
Please help.
thanks
Abhijit
In this case instead of using send mediator to invoke the web service you can use the call out mediator. Which makes a blocking call to error handling service and returns to the same place.
And also with esb 4.0.3 you can specify the receive sequence at the send mediator level. By default the response is received at the outsequence level.
eg. <send receive="fundTransferSequence">
<endpoint>
<address encoding="UTF-8" statistics="disable"
uri="http://10.1.23.11:8888/EgateValidWS/EgateValidWSSoapHttpPort" >
</address>
</endpoint>
</send>