title: Moving Camel Spring XML to Spring Boot
body: <p>I would like to move several of our camel application to Spring Boot.  Most of the examples I find are using the java dsl.  The application we currently support are all based on Spring XML.</p>
  
  <p>What steps should I take to migrate these application to Spring Boot.  If I use FatJarRouter it is my understanding that a camel context is auto-cofigured already, so it seems to me I should be able to just define routes in spring xml.</p>
  
  <pre><code>@SpringBootApplication
  @ImportResource("classpath:camel-context.xml")
  public class CamelApplication extends FatJarRouter {
  
      public static void main(String[] args) {
          SpringApplication.run(CamelApplication.class, args);
      }
  
      @Bean
      String myBean() {
          return "I'm Spring bean!";
      }
  }
  </code></pre>
  
  <p>camel-context.xml</p>
  
  
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         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"&gt;
      &lt;routes xmlns="http://camel.apache.org/schema/spring"&gt;
          &lt;route id="test"&gt;
              &lt;from uri="timer://trigger"/&gt;
              &lt;transform&gt;
                  &lt;simple&gt;ref:myBean&lt;/simple&gt;
              &lt;/transform&gt;
              &lt;to uri="log:out"/&gt;
          &lt;/route&gt;
      &lt;/routes&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Exception</p>
  
  <pre><code>2015-11-13 15:59:13.734  WARN 2156 --- [on(5)-127.0.0.1] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt
  org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [routes]
  Offending resource: class path resource [camel-context.xml]
      at org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal(FailFastProblemReporter.java:60) ~[spring-beans-4.2.2.RELEASE.jar:na]
      at org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:68) ~[spring-beans-4.2.2.RELEASE.jar:na]
  </code></pre>