title: Camel: restlet bean cannot be found
body: <p>I am attempting to set up the hosting of a REST service within Camel using the Java DSL, Netbeans, and Tomcat. It is giving me the following stacktrace:</p>
  
  <pre><code>SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[rest:get:/update:/hello?routeId=route1&amp;c... because of No bean could be found in the registry for: restlet of type: org.apache.camel.spi.RestConsumerFactory
    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1756)
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:138)
    at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:361)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5017)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5531)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1912)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>I have the following in my route builder:</p>
  
  <pre><code>package com.api.camelthree.camelroutes;
  
  import org.apache.camel.Expression;
  import org.apache.camel.model.rest.RestBindingMode;
  import org.apache.camel.spring.SpringRouteBuilder;
  
  import com.api.camelthree.processors.IncomingOrderUpdate;
  
  public class IncomingUrlRouteBuilder extends SpringRouteBuilder {
      public void configure() {
          restConfiguration().component("restlet").host("localhost").port(8080).bindingMode(RestBindingMode.auto);
  
          rest("/update")
              .get("/hello").to("direct:hey")
          ;
  
          from("direct:hey")
              .transform().constant("Hey World")
          ;
      }
  }
  </code></pre>
  
  <p>And just for completeness, here is the pom:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.api&lt;/groupId&gt;
      &lt;artifactId&gt;CamelThree&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;name&gt;CamelThree&lt;/name&gt;
  
      &lt;properties&gt;
          &lt;endorsed.dir&gt;${project.build.directory}/endorsed&lt;/endorsed.dir&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;cxf-version&gt;2.6.1&lt;/cxf-version&gt;
          &lt;camel-version&gt;2.19.0&lt;/camel-version&gt;
          &lt;spring-version&gt;4.1.6.RELEASE&lt;/spring-version&gt;
          &lt;!--log4j-version&gt;&lt;/log4j-version--&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&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-restlet&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-servlet&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-servletlistener&lt;/artifactId&gt;  &lt;version&gt;${camel-version}&lt;/version&gt;    &lt;/dependency&gt;
  
          &lt;!-- spring --&gt;
          &lt;dependency&gt;&lt;groupId&gt;org.springframework&lt;/groupId&gt;  &lt;artifactId&gt;spring-web&lt;/artifactId&gt;     &lt;version&gt;${spring-version}&lt;/version&gt;    &lt;/dependency&gt;
  
          &lt;dependency&gt;&lt;groupId&gt;javax.servlet&lt;/groupId&gt;        &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;&lt;version&gt;3.1.0&lt;/version&gt;              &lt;/dependency&gt;
  
          &lt;!-- logging --&gt;
          &lt;!--dependency&gt;&lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt; &lt;artifactId&gt;log4j-api           &lt;/artifactId&gt;   &lt;version&gt;log4j-version&lt;/version&gt; &lt;scope&gt;runtime&lt;/scope&gt;  &lt;/dependency--&gt;
          &lt;!--dependency&gt;&lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt; &lt;artifactId&gt;log4j-core          &lt;/artifactId&gt;   &lt;version&gt;log4j-version&lt;/version&gt; &lt;scope&gt;runtime&lt;/scope&gt;  &lt;/dependency--&gt;
          &lt;!--dependency&gt;&lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt; &lt;artifactId&gt;log4j-slf4j-impl    &lt;/artifactId&gt;   &lt;version&gt;log4j-version&lt;/version&gt; &lt;scope&gt;runtime&lt;/scope&gt;  &lt;/dependency--&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                      &lt;compilerArguments&gt;
                          &lt;endorseddirs&gt;${endorsed.dir}&lt;/endorseddirs&gt;
                      &lt;/compilerArguments&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;validate&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;copy&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;outputDirectory&gt;${endorsed.dir}&lt;/outputDirectory&gt;
                              &lt;silent&gt;true&lt;/silent&gt;
                              &lt;artifactItems&gt;
                                  &lt;artifactItem&gt;
                                      &lt;groupId&gt;javax&lt;/groupId&gt;
                                      &lt;artifactId&gt;javaee-endorsed-api&lt;/artifactId&gt;
                                      &lt;version&gt;6.0&lt;/version&gt;
                                      &lt;type&gt;jar&lt;/type&gt;
                                  &lt;/artifactItem&gt;
                              &lt;/artifactItems&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>If I use the style <code>from("rest:get:hello/{name}.transform(simple(hey ${header.name}")</code>, that works, but I want to understand how <code>/rest</code> works, and would like the automatic binding for JSON input.</p>
  
  <p>Java 1.8
  Camel 2.19
  Netbeans 8.0.2
  Tomcat 7.0.63</p>
  
  <p>Does someone know how to remove the error?</p>