This seems to be a bug in the trunk and the last release. I ran into the same 
problem a couple of times running some other scenarios. Need to dig a little 
deeper before we can say what's exactly going on here.

I wonder how the fault stack became empty in this case. Did you find anything 
useful with regard to that during your debugging session? Which component/class 
is popping the fault stack before the onFault method here?

Thanks,
Hiranya

On May 31, 2013, at 4:29 AM, Prasad Jeewantha <[email protected]> wrote:

> Hi All,
> 
> There is an issue in synapse which Im trying to solve where I get an 
> EmptyStackException when running this sample 
> http://synapse.apache.org/Synapse_Samples.html#Sample57. 
> 
> Here is the stacktrace.
> 
> java.util.EmptyStackException
>     at java.util.Stack.peek(Stack.java:85)
>     at java.util.Stack.pop(Stack.java:67)
>     at 
> org.apache.synapse.endpoints.DynamicLoadbalanceEndpoint$DynamicLoadbalanceFaultHandlerImpl.onFault(DynamicLoadbalanceEndpoint.java:506)
>     at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:54)
>     at 
> org.apache.synapse.endpoints.AbstractEndpoint.invokeNextFaultHandler(AbstractEndpoint.java:618)
>     at 
> org.apache.synapse.endpoints.AbstractEndpoint.onFault(AbstractEndpoint.java:467)
>     at 
> org.apache.synapse.endpoints.AddressEndpoint.onFault(AddressEndpoint.java:43)
>     at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:102)
>     at 
> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:243)
>     at 
> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
>     at 
> org.apache.synapse.transport.passthru.TargetErrorHandler$1.run(TargetErrorHandler.java:132)
>     at 
> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>     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)
> 
> What I saw while debugging was that when an endpoint send(Msgctx) method is 
> invoked, a fault handler is pushed to a stack in MessageContext. When the 
> message goes to another endpoint, another fault handler will be pushed to the 
> stack in the send(Msgctx) method of the second endpoint. But as far as I 
> figured out, the fault handlers are poped from the stack only when a fault 
> occurs, i.e. in the onFalut() method of a fault handler.
> 
> My question is, should'nt we pop a fault handler from the stack, when the 
> message goes out from an endpoint? Otherwise how do we figure out which fault 
> handler in the stack belongs to which endpoint? 
> 
> It would be great if someone can explain me briefly the architecture of fault 
> hanlding in synapse. Any help is appreciated.
> 
> Thanks,
> PJ
> 
> 
> 
> 
> 

--
Hiranya Jayathilaka
Mayhem Lab/RACE Lab;
Dept. of Computer Science, UCSB;  http://cs.ucsb.edu
E-mail: [email protected];  Mobile: +1 (805) 895-7443
Blog: http://techfeast-hiranya.blogspot.com

Reply via email to