title: Spring Boot + Apache Camel HTTP component crashes at start: missing EmbeddedServletContainerFactory bean
body: <p>Just taking Spring-Boot for a spin and decided to mix in Camel because I need some arcane Headers work in the rest client I am working on. Setting up the application was fine until I added the camel-http component to my POM, then I get this on init:</p>
  
  <pre><code>Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
  </code></pre>
  
  <p>I've havent got the first idea of where to start to look for the problem. I gather Spring Boot will look up the classpath and try to wire stuff up, so is there a way for the to block the Camel packages from being acted on or something of the sort?</p>
  
  <p>Complete log of the start up in this <a href="https://gist.github.com/vantroy/8511855" rel="nofollow">Gist</a></p>
  
  <p>Here's my main aplication code:</p>
  
  <pre><code>@ComponentScan
  @EnableAutoConfiguration
  public class Application {
  
      private static ApplicationContext ctx;
  
      public static void main(String[] args) throws Exception {
          ctx = SpringApplication.run(Application.class, args);
  
          //Right outta Spring 4 docs
          System.out.println("Let's inspect the beans provided by Spring Boot:");
          String[] beanNames = ctx.getBeanDefinitionNames();
          Arrays.sort(beanNames);
          for (String beanName : beanNames) {
              System.out.println(beanName);
          }
          //---
  
          // FIXME: ugly hack to allow some POC woek while wait for proper Camel/Spring4 unit tests fix.
          Application app = new Application();
          app.executeTests();
  
      }
  
      /**
       * Dev QOL - unit tests are broken for now, see:
       * https://issues.apache.org/jira/browse/CAMEL-7074
       * &lt;p/&gt;
       * Waiting for fix (Too lay to checkout and build my own Camel)
       */
      private void executeTests() throws Exception {
          testAuth();
      }
  
      @Bean
      DefaultCamelContext camelCtx() throws Exception {
          DefaultCamelContext camel = new DefaultCamelContext();
          camel.addRoutes(cryptsyRouteBuilder());
          camel.start();
          return camel;
      }
  
      @Bean
      public CryptsyRouteBuilder cryptsyRouteBuilder() throws Exception{
          CryptsyRouteBuilder bean = new CryptsyRouteBuilder();
          bean.setCryptsy(cryptsy());
          return bean;
      }
  
      @Bean
      public Cryptsy cryptsy() throws IOException {
          return new Cryptsy();
      }
  
      protected void testAuth() throws Exception {
          ProducerTemplate producer = camelCtx().createProducerTemplate();
          producer.requestBody("direct:start", "Why, hullo there", String.class);
      }
  
  
  }
  </code></pre>
  
  <p>And my POM dependencies:</p>
  
  <pre><code>   &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;0.5.0.BUILD-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencies&gt;
          &lt;!-- Spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!--&lt;dependency&gt;--&gt;
              &lt;!--&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;--&gt;
              &lt;!--&lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;--&gt;
          &lt;!--&lt;/dependency&gt;--&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Camel --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
              &lt;version&gt;${camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-spring&lt;/artifactId&gt;
              &lt;version&gt;${camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-spring-javaconfig&lt;/artifactId&gt;
              &lt;version&gt;${camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-quartz&lt;/artifactId&gt;
              &lt;version&gt;${camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-test-spring&lt;/artifactId&gt;
              &lt;version&gt;${camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-http&lt;/artifactId&gt;
              &lt;version&gt;${camel.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Assorted --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
              &lt;version&gt;2.3.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-codec&lt;/groupId&gt;
              &lt;artifactId&gt;commons-codec&lt;/artifactId&gt;
              &lt;version&gt;1.9&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
  
      &lt;properties&gt;
          &lt;start-class&gt;xxx.xxxx.Application&lt;/start-class&gt;
          &lt;camel.version&gt;2.12.2&lt;/camel.version&gt;
      &lt;/properties&gt;
  </code></pre>