title: WSO2 ESB store and forward - Unexpected error during sending message out
body: <p>Having WSO2 5.0.0 trying to implement the store and forward pattern with a JDBC message store.</p>
  
  <p>Sending a message to the target endpoint throws an exception:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I believe I am missing an important transport, Axis2 or Synapse property, but I am unable to find which one.</p>
  
  <p>Sequences to store and forward are <a href="http://pastebin.com/9E2SPSVm" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I was trying to find out <a href="http://svn.apache.org/viewvc/synapse/tags/2.1.0/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java?view=markup" rel="nofollow noreferrer">in the source codes</a> what could be causing the NullPointerException, but for me it makes no sense as the httpMethod and messageType is defined.</p>
  
  <p>Thank you all for any hint</p>
  
  <p>Edit:
   based on a comment, the Synapse source in use is <a href="https://github.com/wso2/wso2-synapse/blob/release-2.1.7-wso2v6/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java#L538" rel="nofollow noreferrer">here</a>.</p>