camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivanhoe Abrahams (JIRA)" <j...@apache.org>
Subject [jira] Closed: (CAMEL-3413) Using java based RouteBuilder reference in blueprint.xml CameContext definition failing
Date Thu, 09 Dec 2010 17:06:01 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-3413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ivanhoe Abrahams closed CAMEL-3413.
-----------------------------------

    Resolution: Fixed

Referencing a Java based routeBuilder from within the CamelContext in blueprint now works.

> Using java based RouteBuilder reference in blueprint.xml CameContext definition failing
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3413
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3413
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-blueprint
>         Environment: Camel 2.6-SNAPSHOT, Karaf 2.1.2 
>            Reporter: Ivanhoe Abrahams
>            Assignee: Guillaume Nodet
>             Fix For: 2.6.0
>
>
> Hi 
> I am trying to get the Java based RouteBuilder to work using the simple "camel-osgi-example"
project.
> I have downloaded and installed karaf 2.1.2
> I also downloaded the latest 2.6-SNAPSHOT build of Camel (8 Dec 2010).
> I proceeded to unzip the camel download an in Karaf I installed the "camel-core" and
"camel-blueprint" bundles, (I also installed the servicemix jaxb-impl jar)
> I then amended the "camel-osgi-example" project blueprint.xml file, so that it creates
the example RouteBuilder as a bean, and the references the bean from the CamelContext.
> Below is the bluerint.xml file contents,
> <?xml version="1.0" encoding="UTF-8"?>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0"
> 	xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0"
> 	xmlns:camel="http://camel.apache.org/schema/blueprint"
> 	default-activation="eager" default-availability="optional">
> 	<bean id="routeBuilder" class="org.apache.camel.example.osgi.MyRouteBuilder" />
> 	<camelContext xmlns="http://camel.apache.org/schema/blueprint">
> 			<camel:routeBuilder ref="routeBuilder"/>
> <!--		<camel:route>-->
> <!--			<camel:from uri="timer://myTimer?fixedRate=true&amp;period=2000" />-->
> <!--			<camel:bean ref="myTransform" method="transform" />-->
> <!--			<camel:to uri="log:ExampleRouter" />-->
> <!--		</camel:route>-->
> 	</camelContext>
> 	<bean id="myTransform" class="org.apache.camel.example.osgi.MyTransform">
> 		<property name="prefix" value="SpringDSL" />
> 	</bean>
> </blueprint>
>  
> Now when I deploy this bundle in Karaf I encounter the following exception.
> org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize
camel context factory
> 	at org.apache.camel.blueprint.handler.CamelNamespaceHandler$CamelDependenciesFinder.process(CamelNamespaceHandler.java:271)[52:org.apache.camel.camel-blueprint:2.6.0.SNAPSHOT]
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:479)[7:org.apache.aries.blueprint:0.2.0.incubating]
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:299)[7:org.apache.aries.blueprint:0.2.0.incubating]
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:213)[7:org.apache.aries.blueprint:0.2.0.incubating]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_21]
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_21]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_21]
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_21]
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)[:1.6.0_21]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_21]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_21]
> 	at java.lang.Thread.run(Thread.java:619)[:1.6.0_21]
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1
at: >>> Bean[org.apache.camel.example.osgi.MyTransform@7439aca7] <<< in
route: Route[[From[timer://myTimer?fixedRate=true&period=2000]] -> ... because of org.osgi.service.blueprint.container.NoSuchComponentException:
No component with id 'CamelBeanParameterMappingStrategy' could be found
> 	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:773)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:174)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:654)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1559)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1348)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1257)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:65)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1235)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:79)[52:org.apache.camel.camel-blueprint:2.6.0.SNAPSHOT]
> 	at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:72)[52:org.apache.camel.camel-blueprint:2.6.0.SNAPSHOT]
> 	at org.apache.camel.blueprint.handler.CamelNamespaceHandler$CamelDependenciesFinder.process(CamelNamespaceHandler.java:269)[52:org.apache.camel.camel-blueprint:2.6.0.SNAPSHOT]
> 	... 11 more
> Caused by: org.apache.camel.RuntimeCamelException: org.osgi.service.blueprint.container.NoSuchComponentException:
No component with id 'CamelBeanParameterMappingStrategy' could be found
> 	at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1140)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:56)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.component.bean.BeanInfo.createParameterMappingStrategy(BeanInfo.java:115)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.component.bean.BeanProcessor.<init>(BeanProcessor.java:60)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.model.BeanDefinition.createProcessor(BeanDefinition.java:170)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:403)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:174)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:770)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	... 22 more
> Caused by: org.osgi.service.blueprint.container.NoSuchComponentException: No component
with id 'CamelBeanParameterMappingStrategy' could be found
> 	at org.apache.aries.blueprint.container.DependencyGraph.getSortedRecipes(DependencyGraph.java:51)[7:org.apache.aries.blueprint:0.2.0.incubating]
> 	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:214)[7:org.apache.aries.blueprint:0.2.0.incubating]
> 	at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)[7:org.apache.aries.blueprint:0.2.0.incubating]
> 	at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)[7:org.apache.aries.blueprint:0.2.0.incubating]
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:702)[7:org.apache.aries.blueprint:0.2.0.incubating]
> 	at org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:41)[52:org.apache.camel.camel-blueprint:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:47)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:54)[51:org.apache.camel.camel-core:2.6.0.SNAPSHOT]
> 	... 28 more
> Regards 
> Ivanhoe
>  

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


Mime
View raw message