title: how to fix required a bean of type and This application has no explicit mapping for /error in spring boot
body: <p>here is the aborescence of the packages</p>
  <pre><code>com
    +-bass_trans.java_spring_eclips_management
        +-GestionBassTransApplication.java
        |
        +-worker
            +-adaters
            |  +-in
            |  |   +-WorkerController.java (Rest controller use ListOfWorkerImpl)
            |  +-out
            |      +-ListWorkerImpl.java (class implements ListOfWorkerRepository)
            +-application
            |   +-port
            |         +-in
            |         |  +-ListOfWorker.java (interface)
            |         +-out
            |             +-ListOfWorkerRepository.java (interface)
            +-usecase
                 +-ListOfWorkerImpl (class implements ListOfWorker)
  </code></pre>
  <p>// here is my controller class</p>
  <pre><code>@RestController
  @RequestMapping()
  public class WorkerController {
      
      private ListOfWorker listOfWorker;
      
      @Autowired
      public WorkerController(ListOfWorker listOfWorker) {
          this.listOfWorker = listOfWorker;
      }
      
      @GetMapping(&quot;/listWorkers&quot;)
      public List&lt;Worker&gt; getWorkers() {
          return listOfWorker.findAll();
          
      }
      
      @GetMapping(&quot;/hello&quot;)
      public String sayHello(){       
          return &quot;Hello&quot;;
      }}
            
  </code></pre>
  <p>To solve the error concerning required a bean of type... i use this solution</p>
  <pre><code>@SpringBootApplication(scanBasePackages={
  &quot;bj.com.bass_trans.java_spring_eclips_management.worker.application.port.out.ListOfWorkerRepository&quot;,
  &quot;bj.com.bass_trans.java_spring_eclips_management.worker.application.port.in.ListOfWorker&quot;
  //....)}
  </code></pre>
  <p>now i found
  <code>This application has no explicit mapping for /error in spring boot</code>
  to resolved i use</p>
  <pre><code>@SpringBootApplication(scanBasePackages={
    &quot;bj.com.bass_trans.java_spring_eclips_management.worker.adapters.in&quot;
  //...)}
  </code></pre>
  <p>after that line <strong>required a bean of type...</strong> reappears</p>
  <p>i thing that is caus of<br />
  <code> bj.com.bass_trans.java_spring_eclips_management.worker.adapters.in.WorkerController</code></p>
  <p>// main class</p>
  <pre><code>@SpringBootApplication(scanBasePackages={
  &quot;bj.com.bass_trans.java_spring_eclips_management.worker.application.port.out.ListOfWorkerRepository&quot;,
  &quot;bj.com.bass_trans.java_spring_eclips_management.worker.application.port.in.ListOfWorker&quot;,
  &quot;bj.com.bass_trans.java_spring_eclips_management.worker.adapters.in.WorkerController&quot;,
  &quot;bj.com.bass_trans.java_spring_eclips_management.worker.adapters.in&quot;,
  })
  public class GestionBassTransApplication implements CommandLineRunner{
      public static void main(String[] args) {
          SpringApplication.run(GestionBassTransApplication.class, args);
      }
      @Override
      public void run(String... args) throws Exception {
  
      }
  
  }
  </code></pre>
  <p>// complete error</p>
  <pre><code>
  Description:
  
  Parameter 0 of constructor in bj.com.bass_trans.java_spring_eclips_management.worker.adapters.in.WorkerController required a bean of type 'bj.com.bass_trans.java_spring_eclips_management.worker.application.port.in.ListOfWorker' that could not be found.
  
  
  Action:
  
  Consider defining a bean of type 'bj.com.bass_trans.java_spring_eclips_management.worker.application.port.in.ListOfWorker' in your configuration.
  </code></pre>
  <p>// This application has no explicit mapping...</p>
  <pre><code>Whitelabel Error Page
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
  
  Mon Dec 13 15:24:37 WAT 2021
  There was an unexpected error (type=Not Found, status=404).
  No message available
  </code></pre>
  <p>how  how can i solve these errors</p>