You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by pthotapalle <pr...@gmail.com> on 2016/08/31 16:25:23 UTC

Karaf - org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: Cannot find RouteContext with id "routes-id"

Hi,

I am using my camel routes on Karaf. Tried to keep routes in separate bundle
(just xmls in deploy folder) and tied them with <routeContextRef> in main
mycamelcontext.xml

Here are my files look like.

*mycamelcontext.xml*

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
	   http://www.springframework.org/schema/beans 
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
	   http://www.springframework.org/schema/osgi  
       http://www.springframework.org/schema/osgi/spring-osgi.xsd
       http://camel.apache.org/schema/spring 
       http://camel.apache.org/schema/spring/camel-spring.xsd
	   http://www.springframework.org/schema/util 
	   http://www.springframework.org/schema/util/spring-util-2.5.xsd
	   http://www.springframework.org/schema/context
      
http://www.springframework.org/schema/context/spring-context-2.5.xsd">

	*<import resource="routes.xml"/>* 
	<camelContext id="mycamel-core-context"
xmlns="http://camel.apache.org/schema/spring">
	
		*<routeContextRef ref="routes-id"/>*
	
	</camelContext>
</beans>

*routes.xml*
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://camel.apache.org/schema/spring
      http://camel.apache.org/schema/spring/camel-spring.xsd
      http://www.springframework.org/schema/osgi
      http://www.springframework.org/schema/osgi/spring-osgi.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context.xsd">

	<routeContext id="routes-id" xmlns="http://camel.apache.org/schema/spring">
	
	 <route id="route1" autoStartup="true">
        </route>
		
    </routeContext>
</beans>


But, I am not getting below exception while starting the bundle
'mycamelcontext.xml'
org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException:
Cannot find RouteContext with id 'routes-id'.

Not sure what am I missing here. Can you guys throw some light?

Thanks,
Prathap



--
View this message in context: http://camel.465427.n5.nabble.com/Karaf-org-apache-camel-RuntimeCamelException-java-lang-IllegalArgumentException-Cannot-find-RouteCon-tp5787066.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Karaf - org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: Cannot find RouteContext with id "routes-id"

Posted by pthotapalle <pr...@gmail.com>.
Ok!, I packaged all xmls in bundle jar and that worked. 



--
View this message in context: http://camel.465427.n5.nabble.com/Karaf-org-apache-camel-RuntimeCamelException-java-lang-IllegalArgumentException-Cannot-find-RouteCon-tp5787066p5787102.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Karaf - org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: Cannot find RouteContext with id "routes-id"

Posted by Claus Ibsen <cl...@gmail.com>.
Your xml files must be in the same bundle.



On Wed, Aug 31, 2016 at 6:25 PM, pthotapalle <pr...@gmail.com> wrote:
> Hi,
>
> I am using my camel routes on Karaf. Tried to keep routes in separate bundle
> (just xmls in deploy folder) and tied them with <routeContextRef> in main
> mycamelcontext.xml
>
> Here are my files look like.
>
> *mycamelcontext.xml*
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:osgi="http://www.springframework.org/schema/osgi"
>         xmlns:context="http://www.springframework.org/schema/context"
>         xsi:schemaLocation="
>            http://www.springframework.org/schema/beans
>        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>            http://www.springframework.org/schema/osgi
>        http://www.springframework.org/schema/osgi/spring-osgi.xsd
>        http://camel.apache.org/schema/spring
>        http://camel.apache.org/schema/spring/camel-spring.xsd
>            http://www.springframework.org/schema/util
>            http://www.springframework.org/schema/util/spring-util-2.5.xsd
>            http://www.springframework.org/schema/context
>
> http://www.springframework.org/schema/context/spring-context-2.5.xsd">
>
>         *<import resource="routes.xml"/>*
>         <camelContext id="mycamel-core-context"
> xmlns="http://camel.apache.org/schema/spring">
>
>                 *<routeContextRef ref="routes-id"/>*
>
>         </camelContext>
> </beans>
>
> *routes.xml*
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:osgi="http://www.springframework.org/schema/osgi"
>         xmlns:context="http://www.springframework.org/schema/context"
>         xsi:schemaLocation="http://www.springframework.org/schema/beans
>       http://www.springframework.org/schema/beans/spring-beans.xsd
>       http://camel.apache.org/schema/spring
>       http://camel.apache.org/schema/spring/camel-spring.xsd
>       http://www.springframework.org/schema/osgi
>       http://www.springframework.org/schema/osgi/spring-osgi.xsd
>       http://www.springframework.org/schema/context
>       http://www.springframework.org/schema/context/spring-context.xsd">
>
>         <routeContext id="routes-id" xmlns="http://camel.apache.org/schema/spring">
>
>          <route id="route1" autoStartup="true">
>         </route>
>
>     </routeContext>
> </beans>
>
>
> But, I am not getting below exception while starting the bundle
> 'mycamelcontext.xml'
> org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException:
> Cannot find RouteContext with id 'routes-id'.
>
> Not sure what am I missing here. Can you guys throw some light?
>
> Thanks,
> Prathap
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Karaf-org-apache-camel-RuntimeCamelException-java-lang-IllegalArgumentException-Cannot-find-RouteCon-tp5787066.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2