title: Solve "Failed to create route route1 at: >>> To[stream.out]" in Camel
body: <p>This is the class that I have written to read message from a queue</p>
  
  <pre><code>public class Sender {
      public static void main(String[] args) throws Exception {
          CamelContext camelContext = new DefaultCamelContext();
          camelContext.addRoutes( new RouteBuilder() {
              @Override
              public void configure() throws Exception {
                  from("rabbitmq://localhost:5672/tasks?queue=learningqueue").to("stream:out");
              }
          } );
          camelContext.start();
      }
  }
  </code></pre>
  
  <p>But when i run the above code I get following error. I have already added the camel-stream dependency.</p>
  
  <pre><code>Exception in thread "main" org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: &gt;&gt;&gt; To[stream.out] &lt;&lt;&lt; in route: Route(route1)[[From[rabbitmq://localhost:5672/tasks?queue=le... because of No endpoint could be found for: stream.out, please check your classpath contains the needed Camel component jar.
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1071)
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:196)
      at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1008)
      at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3397)
      at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3128)
      at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:182)
      at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2957)
      at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2953)
      at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2976)
      at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2953)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
      at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2920)
      at Learndata.camel.exam.sendrecv.Sender.main(Sender.java:16)
  Caused by: org.apache.camel.NoSuchEndpointException: No endpoint could be found for: stream.out, please check your classpath contains the needed Camel component jar.
      at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:81)
      at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:211)
      at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)
      at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)
      at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:62)
      at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:56)
      at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:539)
      at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
      at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:221)
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1068)
      ... 12 more
  </code></pre>
  
  <p>This is my entire POM.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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/maven-v4_0_0.xsd"&gt;
  
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;camel.activemq&lt;/groupId&gt;
    &lt;artifactId&gt;rabbitmq&lt;/artifactId&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
    &lt;name&gt;ActiveMQ embedded with Camel&lt;/name&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
        &lt;!-- Camel BOM --&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
          &lt;artifactId&gt;camel-parent&lt;/artifactId&gt;
          &lt;version&gt;2.19.2&lt;/version&gt;
          &lt;scope&gt;import&lt;/scope&gt;
          &lt;type&gt;pom&lt;/type&gt;
        &lt;/dependency&gt;
      &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
        &lt;artifactId&gt;camel-rabbitmq&lt;/artifactId&gt;
        &lt;version&gt;2.19.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
  &lt;!-- https://mvnrepository.com/artifact/org.apache.camel/camel-stream --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
      &lt;artifactId&gt;camel-stream&lt;/artifactId&gt;
      &lt;version&gt;2.19.1&lt;/version&gt;
  &lt;/dependency&gt;
  
        &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
        &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
        &lt;artifactId&gt;camel-jms&lt;/artifactId&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;/dependency&gt;
  
      &lt;!-- the ActiveMQ client with connection pooling --&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
        &lt;artifactId&gt;activemq-client&lt;/artifactId&gt;
        &lt;version&gt;5.14.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
        &lt;artifactId&gt;activemq-camel&lt;/artifactId&gt;
        &lt;version&gt;5.14.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
        &lt;artifactId&gt;activemq-pool&lt;/artifactId&gt;
        &lt;version&gt;5.14.5&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- the ActiveMQ broker is optional and can be removed if connecting to a remote broker only --&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
        &lt;artifactId&gt;activemq-broker&lt;/artifactId&gt;
        &lt;version&gt;5.14.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
        &lt;artifactId&gt;activemq-spring&lt;/artifactId&gt;
        &lt;version&gt;5.14.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
        &lt;artifactId&gt;activemq-kahadb-store&lt;/artifactId&gt;
        &lt;version&gt;5.14.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.xbean&lt;/groupId&gt;
        &lt;artifactId&gt;xbean-spring&lt;/artifactId&gt;
        &lt;version&gt;4.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
        &lt;version&gt;4.3.10.RELEASE&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;scope&gt;test&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;scope&gt;test&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;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
        &lt;artifactId&gt;log4j-1.2-api&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- testing --&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
        &lt;artifactId&gt;camel-test-spring&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  
    &lt;build&gt;
      &lt;defaultGoal&gt;install&lt;/defaultGoal&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;3.6.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.8&lt;/source&gt;
            &lt;target&gt;1.8&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.0.2&lt;/version&gt;
          &lt;configuration&gt;
            &lt;encoding&gt;UTF-8&lt;/encoding&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
  
        &lt;!-- allows the route to be ran via 'mvn camel:run' --&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
          &lt;artifactId&gt;camel-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.19.2&lt;/version&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Since I have to use camel activemq I have put those dependencies also. Could that be the reason it's not working properly ?</p>