title: Issue launching Spring webapp on JBoss
body: <p>When i trying to deploy my project, this presents a problem with the bean, i have not been able to solve it, i attach the error and the class that generates it. I need help to solve this please.
  I thank you in advance.</p>
  
  <hr>
  
  <p>APPLICATION FAILED TO START</p>
  
  <hr>
  
  <p>Description:</p>
  
  <blockquote>
    <p>Field sender in co.com.coomeva.golden.service.ws.main.GreetingController required a bean of type 'co.com.coomeva.golden.service.ws.jms.DistributorSender' that could not be found.
    The injection point has the following annotations:- @org.springframework.beans.factory.annotation.Autowired(required=true)
    Action:Consider defining a bean of type 'co.com.coomeva.golden.service.ws.jms.DistributorSender' in your configuration.
    22:41:15,280 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 69) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./Golden: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./Golden: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'greetingController': Unsatisfied dependency expressed through field 'sender'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'co.com.coomeva.golden.service.ws.jms.DistributorSender' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:84)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        at org.jboss.threads.JBossThread.run(JBossThread.java:320)
    Caused by: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'greetingController': Unsatisfied dependency expressed through field 'sender'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'co.com.coomeva.golden.service.ws.jms.DistributorSender' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:241)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:99)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
        ... 6 more</p>
  </blockquote>
  
  <pre><code>    package co.com.coomeva.golden.service.ws.main;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.builder.SpringApplicationBuilder;
  import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.http.HttpStatus;
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.PathVariable;
  import org.springframework.web.bind.annotation.PostMapping;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  import co.com.coomeva.golden.service.ws.jms.*;
  import co.com.coomeva.golden.service.ws.model.GoldenResponse;
  
  @Configuration
  @ComponentScan
  @EnableAutoConfiguration
  @SpringBootApplication(scanBasePackages = { "co.com.coomeva.golden.service.ws.controllers", "co.com.coomeva.golden.service.ws.jms.DistributorSender"})
  public class GoldenServiceApplication extends SpringBootServletInitializer {
  
      public static void main(String[] args) {
          SpringApplication.run(applicationClass, args);
      }
  
      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
          return application.sources(applicationClass);
      }
  
      private static Class&lt;GoldenServiceApplication&gt; applicationClass = GoldenServiceApplication.class;
  }
  
  @RestController
  class GreetingController {
  
      @Autowired
      private DistributorSender sender;
  
      @PostMapping("/distributor/records")
      public GoldenResponse setGoldenRecord(@RequestBody String goldenRecord) {
          GoldenResponse response = new GoldenResponse();
  
          try {
              sender.publishMessage(goldenRecord);
              response.setCode(HttpStatus.OK.value());
              response.setMessage("Golden Record Published");
          } catch (Exception e) {
              String error = e.getCause().toString();
              error = error.length() &gt; 200 ? error.substring(0, 200) : error;
              response.setMessage("Golden Record was not published. Error:" + error);
          }
  
          return response;
      }
  
      @RequestMapping("/hello/{name}")
      String hello(@PathVariable String name) {
          return "Hello, " + name + "!";
      }
  
      @GetMapping("/Example2")
      public GoldenResponse exampleDist() {
          GoldenResponse goldenResponse = new GoldenResponse();
          goldenResponse.setCode(1);
          goldenResponse.setMessage("sd");
          System.out.println("Vinagre");
          return goldenResponse;
      }
  
  }
  </code></pre>