title: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for:
body: <p>I have the following route definition:</p>
  
  <pre><code>@Component
  public class CamelRoutes extends RouteBuilder {
      @Override
      public void configure() throws Exception {
             from("seda:second")                   
                  .bean("helloWorld?method=smth")    
                  .process(exchange -&gt; {
                      System.out.println("Message:" + exchange.getIn().getBody());
                  })
                  .log("body:${body}");
  </code></pre>
  
  <p>and following bean:</p>
  
  <pre><code>public static class HelloWorld {
         public void execute(String str){
             System.out.println("HelloWorld#execute: " + str);
         }
          public void smth(String str){
              System.out.println("HelloWorld#smth: " + str);
          }
      }
  </code></pre>
  
  <p>But application doesn't start.<br>
  trace:</p>
  
  <pre><code>org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route4 at: &gt;&gt;&gt; Bean[ref:helloWorld?method=smth] &lt;&lt;&lt; in route: Route(route4)[[From[seda:second]] -&gt; [Bean[ref:helloWorld?me... because of No bean could be found in the registry for: helloWorld?method=smth
      at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1831) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136) ~[camel-spring-2.20.0.jar:2.20.0]
      at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:174) ~[camel-spring-2.20.0.jar:2.20.0]
      at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at SpringBootCamelIntegrationApplication.main(SpringBootCamelIntegrationApplication.java:9) [classes/:na]
  Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route4 at: &gt;&gt;&gt; Bean[ref:helloWorld?method=smth] &lt;&lt;&lt; in route: Route(route4)[[From[seda:second]] -&gt; [Bean[ref:helloWorld?me... because of No bean could be found in the registry for: helloWorld?method=smth
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1298) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:204) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1135) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3714) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3428) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:208) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3236) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3232) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3255) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3232) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3155) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133) ~[camel-spring-2.20.0.jar:2.20.0]
      ... 15 common frames omitted
  Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: helloWorld?method=smth
      at org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:94) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.component.bean.RegistryBean.createCacheHolder(RegistryBean.java:69) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.BeanDefinition.createProcessor(BeanDefinition.java:251) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:549) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:510) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:226) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1295) ~[camel-core-2.20.0.jar:2.20.0]
      ... 27 common frames omitted
  </code></pre>
  
  <p>What wrong with my code base ?</p>
  
  <h2>update:</h2>
  
  <p>According <a href="https://stackoverflow.com/questions/46907227/org-apache-camel-nosuchbeanexception-no-bean-could-be-found-in-the-registry-for/46907355?noredirect=1#comment80761967_46907355">Romat Vottnet advice</a> I've wrote following:</p>
  
  <pre><code>@Component
  public class CamelRoutes extends RouteBuilder {
      @Override
      public void configure() throws Exception {
  
          from("seda:second")                    
                  .bean("helloWorld?method=smth()");
  
      }
  
      public static class HelloWorld {
          public void execute(String str) {
              System.out.println("HelloWorld#execute: " + str);
          }
  
          public void smth(String str) {
              System.out.println("HelloWorld#smth: " + str);
          }
      }
  
      @Bean(name = "helloWorld")
      public HelloWorld helloWorld() {
          return new HelloWorld();
      }
  }
  </code></pre>
  
  <p>But I see:</p>
  
  <pre><code>org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route4 at: &gt;&gt;&gt; Bean[ref:helloWorld?method=smth()] &lt;&lt;&lt; in route: Route(route4)[[From[seda:second]] -&gt; [Bean[ref:helloWorld?me... because of No bean could be found in the registry for: helloWorld?method=smth()
      at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1831) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136) ~[camel-spring-2.20.0.jar:2.20.0]
      at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:174) ~[camel-spring-2.20.0.jar:2.20.0]
      at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
      at SpringBootCamelIntegrationApplication.main(SpringBootCamelIntegrationApplication.java:9) [classes/:na]
  Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route4 at: &gt;&gt;&gt; Bean[ref:helloWorld?method=smth()] &lt;&lt;&lt; in route: Route(route4)[[From[seda:second]] -&gt; [Bean[ref:helloWorld?me... because of No bean could be found in the registry for: helloWorld?method=smth()
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1298) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:204) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1135) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3714) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3428) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:208) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3236) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3232) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3255) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3232) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3155) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133) ~[camel-spring-2.20.0.jar:2.20.0]
      ... 15 common frames omitted
  Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: helloWorld?method=smth()
      at org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:94) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.component.bean.RegistryBean.createCacheHolder(RegistryBean.java:69) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.BeanDefinition.createProcessor(BeanDefinition.java:251) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:549) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:510) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:226) ~[camel-core-2.20.0.jar:2.20.0]
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1295) ~[camel-core-2.20.0.jar:2.20.0]
      ... 27 common frames omitted
  </code></pre>
  
  <p>when application starts.</p>
  
  <p>I checked - method marked as <code>@Bean</code> is invoked.</p>