camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rogelio_sevilla1 <rogelio.sevil...@gmail.com>
Subject Re: Instantiating an osgi bundled camel route from another bundle
Date Fri, 22 Jul 2011 19:47:38 GMT
Found one of my errors, i should have used the CamelContextFactory instead of
the default context. I changed my RouteFactory implementation to this:


 MyRoute miruta = new MyRoute();
        BundleContext bundleContext = Activator.getBundleContext();
        CamelContextFactory camelContextFactory = new CamelContextFactory();
        camelContextFactory.setBundleContext(bundleContext);
        DefaultCamelContext defaultContext =
camelContextFactory.createContext();
        defaultContext.addRoutes(miruta);
        defaultContext.start();


Now i'm getting a weird exception, it seems that camel cannot find one of
the classes that is used in one of my routes. But i don't understand, the
class that camel is complaining about is included in the same bundle and the
same package where i'm getting the route from the beginning :-S , which is
also exported through the pom file.  Here's the exception i'm getting:



ERROR | rint Extender: 1 | BlueprintContainerImpl           | 10 -
org.apache.aries.blueprint - 0.3.1 | Unable to start blueprint container for
bundle my_routes_factory
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
intialize bean MyRoutesFactory
	at
org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:638)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:724)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:147)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:640)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:331)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:227)[10:org.apache.aries.blueprint:0.3.1]
	at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_25]
	at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_25]
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_25]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_25]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)[:1.6.0_25]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_25]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_25]
	at java.lang.Thread.run(Thread.java:662)[:1.6.0_25]
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create
route route5 at: >>> Bean[com.mycompany.my_main_route.MyPojo.class] <<<
in
route: Route[[From[quartz://fetchUrl?cron=0+0/1+*+*+*+?]] -> [Bean[...
because of java.lang.ClassNotFoundException:
com.mycompany.my_main_route.MyPojo.class
	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:818)
	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
	at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:708)
	at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1650)
	at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1439)
	at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1338)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
	at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1316)
	at
com.my_company.my_route_factory.MyRouteFactory.init(MyRouteFactory.java:39)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_25]
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_25]
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_25]
	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_25]
	at
org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824)[10:org.apache.aries.blueprint:0.3.1]
	at
org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:636)[10:org.apache.aries.blueprint:0.3.1]
	... 15 more
Caused by: org.apache.camel.RuntimeCamelException:
java.lang.ClassNotFoundException: com.mycompany.my_main_route.MiPojo
	at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
	at
org.apache.camel.model.BeanDefinition.createProcessor(BeanDefinition.java:164)
	at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:433)
	at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:181)
	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:815)
	... 31 more
Caused by: java.lang.ClassNotFoundException:
com.flytecomm.noaa_atom_feed_consumer.AtomFeedMessageConversorBean
	at
org.apache.camel.impl.DefaultClassResolver.resolveMandatoryClass(DefaultClassResolver.java:52)
	at
org.apache.camel.model.BeanDefinition.createProcessor(BeanDefinition.java:162)
	... 34 more



Any advice??




--
View this message in context: http://camel.465427.n5.nabble.com/Instantiating-an-osgi-bundled-camel-route-from-another-bundle-tp4623697p4624476.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message