[ 
https://issues.apache.org/jira/browse/CAMEL-6920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13810386#comment-13810386
 ] 

Zach Calvert commented on CAMEL-6920:
-------------------------------------

Side notes:
I have tried ferociously to work around this issue without having to create a 
bug report as I'm well aware this is an old component that may not be fully 
maintained.  However, nothing is working.

I have enforced in the pom.xml:
{code}
 <Require-Bundle>org.apache.camel.camel-cxf</Require-Bundle>
{code}
which guarantees the camel-cxf bundle is up and running.  This does not fix the 
issue.

In addition, I reviewed the code and figured out that components are actually 
camel services with properties defining the component name.  To try to 
guarantee that the component is actually up and running before using it, I have 
included this in the camel-context.xml which ensure the service is truly up and 
running:
{code}
    <!-- this forces our delay to start after cxfbean starts -->
    <osgi:reference id="cxfbeanReference" cardinality="1..1" 
interface="org.apache.camel.spi.ComponentResolver" filter="(component=cxfbean)" 
/>
{code}

I even went through the hassle of creating an OSGI Lifecycle listener and made 
sure I was actually receiving the component service.  While the service is up 
and running, it would seem camel is concurrently preparing to enable the 
"cxfbean" component while it is bringing up camel routes that require the 
component and subsequently failing.  This is a race condition that is solved 
only by waiting a given amount of time and then forcing a bundle update.  


> Component Resolution for CXFBean Triggers a Race Condition
> ----------------------------------------------------------
>
>                 Key: CAMEL-6920
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6920
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.10.7
>         Environment: Apache ServiceMix 4.5.3
> Linux centora 2.6.18-308.8.2.el5 #1 SMP Tue Jun 12 09:57:26 EDT 2012 i686 
> i686 i386 GNU/Linux
>            Reporter: Zach Calvert
>         Attachments: cxf-cxfbean-broken.zip
>
>
> Making use of the cxfbean camel component triggers a race condition in 
> ServiceMix startup.
> Logs received:
> {code}
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve 
> endpoint: cxfbean://failureProof due to: No component found with scheme: 
> cxfbean
>         at 
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:495)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:187)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:461)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179)[101:org.apache.camel.camel-core:2.10.7]
>         at 
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:876)[101:org.apache.camel.camel-core:2.10.7]
>         ... 20 more
> {code}
> Will attach example code to trigger error and steps to reproduce in Apache 
> ServiceMix 4.5.3.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to