Tuesday, February 12, 2013

WSO2 ESB NativeWorkerPool Error

Are you getting the NativeWorkerPool uncaught exception, and is unable to determine why this happens in WSO2 Enterprise Service Bus (ESB). If so, read on. There can be several issues that could lead to NativeWorkerPool exception. So, to determine the actual cause for this, you should read the remaining stack trace. 

For example, you may see an exception like the following. [1] There, if you read the third line, you'll notice that it says ...synapse.endpoints.IndirectEndpoint.readyToSend(...). If your stack trace also shows that, then error issue here is quite simple. First of all, we can determine you are using load balance endpoint since it's trying to determine an actual endpoint to send the request to. So, open up your proxy service and get to know what are the actual endpoints that it uses to load balance. 

Make sure that all the endpoints specified there exists. There may be a type between the endpoint name, and reference you specified inside the proxy service. The below error happens due to this reason.


[1]
ERROR - NativeWorkerPool Uncaught exception 
java.lang.NullPointerException 
        at org.apache.synapse.endpoints.IndirectEndpoint.readyToSend(IndirectEndpoint.java:74)         at org.apache.synapse.endpoints.algorithms.RoundRobin.getNextEndpoint(RoundRobin.java:100) 
        at org.apache.synapse.endpoints.LoadbalanceEndpoint.getNextChild(LoadbalanceEndpoint.java:274) 
        at org.apache.synapse.endpoints.LoadbalanceEndpoint.send(LoadbalanceEndpoint.java:105) 
        at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:87) 
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60) 
        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114) 
        at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:154) 
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181) 
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172) 
        at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:408) 
        at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:259) 
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173) 
        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:662) 

1 comment:

  1. Hello Kasun,

    About this kind of exception, when some client like soapui sends a request to some proxy passing a malformed xml, the ESB throws this exception and the stacktrace appears in the log:

    NativeWorkerPool Uncaught exception
    org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element

    I wish to send back to client some appropriated response, like SoapFault. Setting the don't worked. Can you help me?

    ReplyDelete