Hi,
    I have a simple XML file:

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:camel="http://camel.apache.org/schema/spring";
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>


        <camel:camelContext autoStartup="false">
           <camel:route autoStartup="false" shutdownRoute="Defer">
                <camel:from uri="file:data/inbox/file" />
                <camel:to uri="file:data/outbox/" />
           </camel:route>
        </camel:camelContext>
</beans>

which I load from my Java Program using ApplicationContext, the code is
below:

{
        ApplicationContext context = new ClassPathXmlApplicationContext(new
String[]{"routes1.xml"});
            CamelContext camel =
SpringCamelContext.springCamelContext(context);
            System.out.println(camel.getName());
            camel.start();
            Thread.sleep(10000);
            camel.stop();
}

Though for some reasons it does not execute the route specified in the
CamelContext. The file never gets copied. Though I am sure the context is
getting created inside the Java Program. Do I need some additional
configuration parameters to make sure the route defined in the CamelContext
gets started?

I am using camel version: 2.9.2
                 spring version: 3.0.5



Regards,
Gaurav





--
View this message in context: 
http://camel.465427.n5.nabble.com/Loading-CamelContext-from-Spring-XML-file-tp5719024.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to