title: Apache Camel "No component found with scheme: stream"
body: <p>I'm just getting to know Camel (and Maven) and I have this very simple Java example:</p>
  
  <pre><code> public static void main( String[] args ) throws Exception {    
      CamelContext context = new DefaultCamelContext();
  
      context.addRoutes(new RouteBuilder() {
  
            public void configure() { 
              from("direct:in").to("stream:out");     
            }
  
      });
  
      context.start();
  
      ProducerTemplate template = context.createProducerTemplate();
      template.sendBody("direct:in", "Hello Text World"); 
      template.sendBody("direct:in", "Hello Bytes World".getBytes());
  }
  </code></pre>
  
  <p>My maven POM file includes:</p>
  
  <pre><code>&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.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Still I receive a org.apache.camel.FailedToCreateRouteException, because No component found with scheme: stream</p>
  
  <blockquote>
    <p>Exception in thread "main" org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[stream:out] &lt;&lt;&lt; in route: Route(ro
    to: No component found with scheme: stream
            at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1298)
            at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:204)
            at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1087)
            at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3544)
            at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3275)
            at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:202)
            at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3093)
            at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3089)
            at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3112)
            at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3089)
            at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
            at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3026)
            at mavenCamelRiding.binFileStreamToCamel.MainStreamRouter.main(MainStreamRouter.java:37)
    Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: stream://out due to: No component found with scheme: stream
            at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:729)
            at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80)
            at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:219)
            at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
            at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:118)
            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:549)
            at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:510)
            at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:226)
            at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1295)</p>
  </blockquote>
  
  <p>Any idea, where the problem could be? Google wasn't able to help me so far.</p>
  
  <p>edit 1: here is the rest of my POM file</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;mavenCamelRiding&lt;/groupId&gt;
    &lt;artifactId&gt;binFileStreamToCamel&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;binFileStreamToCamel&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
          &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
          &lt;version&gt;2.19.2&lt;/version&gt;
      &lt;/dependency&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.2&lt;/version&gt;
      &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>edit 2: </p>
  
  <p>It obviously has something to do with the way I build and start the program. This confuses me, because I didn't have any problems with any other route options I played around with so far (jms, activemq, file, bean).</p>
  
  <p>I now tested the building and running within Eclipse instead of with the console. So I right-clikced the project folder and selected "Build Project". Then I selected "Run As" and "Java Application". The Eclipse console gives me the expected hello-world-output.</p>
  
  <p>Why doesn't it work with the console?</p>
  
  <p>edit 3:</p>
  
  <p>now instead of first using "mvn compile", moving into the "target\classes" folder and then running "java package.classname", I executed this:</p>
  
  <p>mvn compile exec:java -Dexec.mainClass=package.classname</p>
  
  <p>and it gives me the hello-world-output I wanted.</p>
  
  <p>Sounds like a class path problem? How can I start the example program without maven?</p>