servicemix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruce Snyder (JIRA)" <>
Subject [jira] Updated: (SM-1171) BeanEndpoint can receive messages before it has fully started, causing exceptions
Date Wed, 27 Feb 2008 18:14:17 GMT


Bruce Snyder updated SM-1171:

    Component/s: servicemix-bean

> BeanEndpoint can receive messages before it has fully started, causing exceptions 
> ----------------------------------------------------------------------------------
>                 Key: SM-1171
>                 URL:
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-bean
>    Affects Versions: 3.2, 3.2.1
>            Reporter: Ryan Bohn
> I have a Sender endpoint and a Receiver endpoint, both BeanEndpoint objects.  The Sender
endpoint immediately starts sending messages.  Every so often, the receiver endpoint accepts
tries to process a message the start() method has completed, causing the following exception:
> java.lang.NullPointerException
>         at org.apache.servicemix.bean.BeanEndpoint.getCorrelationExpression(
>         at org.apache.servicemix.bean.BeanEndpoint.getCorrelation(
>         at org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(
>         at org.apache.servicemix.bean.BeanEndpoint.process(
>         at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(
>         at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(
>         at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(
>         at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
>         at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
>         at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(
>         at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at
> For now, I've put a sleep in the sender endpoint, which fixes the problem.  Obviously,
this a hack.
> I originally thought that the original solution would be to move the super.start() call
to the end of the start() method.  However, this turned out to cause problems for the sender
> I have two options to propose:
> - use synchronization to ensure the bean has started, so that the process() method blocks
until the start() method has finished.  This has the disadvantage of incurring a synchronization
hit on each message exchange.
> - separate the activation of an endpoint from the registration.  This way an endpoint
would be ready to go by being activated, but wouldn't be visible to other endpoints until
the start() method has finished.  I'm not sure what code changes would need be necessary to
make this happen.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message