title: Bean of type 'org.springframework.web.reactive.function.client.WebClient' that could not be found
body: <p>I'm studying push notifications using the example of this manual <a href="https://golb.hplar.ch/2018/01/Sending-Web-push-messages-from-Spring-Boot-to-Browsers.html" rel="nofollow noreferrer">https://golb.hplar.ch/2018/01/Sending-Web-push-messages-from-Spring-Boot-to-Browsers.html</a>.
  I am faced with the problem that when I run the application, I get the error</p>
  
  <pre><code>Parameter 1 of constructor in ru.stepanb.MetricPushingApplication.push.PushChuckJokeService required could not be found. 
  
  Consider defining a bean of type 'org.springframework.web.reactive.function.client.WebClient' in your configuration. " 
  </code></pre>
  
  <p>.</p>
  
  <pre><code>import org.springframework.scheduling.annotation.Scheduled;
  import org.springframework.stereotype.Service;
  import org.springframework.web.reactive.function.client.WebClient;
  
  @Service
  public class PushChuckJokeService {
  
    private final FcmClient fcmClient;
  
    private final WebClient webClient;
  
    private int seq = 0;
  
    public PushChuckJokeService(FcmClient fcmClient, WebClient webClient) {
       this.fcmClient = fcmClient;
       this.webClient = webClient;
    }
  
    @Scheduled(fixedDelay = 30_000)
    public void sendChuckQuotes() {
      IcndbJoke joke = 
      this.webClient.get().uri("http://api.icndb.com/jokes/random")
      .retrieve().bodyToMono(IcndbJoke.class).block();
       try {
        sendPushMessage(joke);
       } 
      catch (InterruptedException | ExecutionException e) {
        //Application.logger.error("send chuck joke", e);
     }
    }
  
    void sendPushMessage(IcndbJoke joke) throws InterruptedException, 
      ExecutionException {
        Map&lt;String, String&gt; data = new HashMap&lt;&gt;();
        data.put("id", String.valueOf(joke.getValue().getId()));
        data.put("joke", joke.getValue().getJoke());
        data.put("seq", String.valueOf(this.seq++));
        data.put("ts", String.valueOf(System.currentTimeMillis()));
  
        System.out.println("Sending chuck joke...");
        this.fcmClient.send(data);
       }
  
    }
  </code></pre>
  
  <p>Here is my pom.xml 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;ru.stepanb&lt;/groupId&gt;
  &lt;artifactId&gt;MetricPushingApplication&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;MetricPushingApplication&lt;/name&gt;
  &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;2.1.5.RELEASE&lt;/version&gt;
      &lt;relativePath /&gt;
  &lt;/parent&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;java.version&gt;1.8&lt;/java.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-webflux&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.firebase&lt;/groupId&gt;
          &lt;artifactId&gt;firebase-admin&lt;/artifactId&gt;
          &lt;version&gt;6.8.1&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
                  &lt;artifactId&gt;jackson-core-asl&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.http-client&lt;/groupId&gt;
                  &lt;artifactId&gt;google-http-client-jackson&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.http-client&lt;/groupId&gt;
                  &lt;artifactId&gt;google-http-client-gson&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.api-client&lt;/groupId&gt;
                  &lt;artifactId&gt;google-api-client-gson&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;joda-time&lt;/groupId&gt;
                  &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
                  &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.auto.value&lt;/groupId&gt;
                  &lt;artifactId&gt;auto-value&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.threeten&lt;/groupId&gt;
                  &lt;artifactId&gt;threetenbp&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.json&lt;/groupId&gt;
                  &lt;artifactId&gt;json&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;google-cloud-firestore&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.apis&lt;/groupId&gt;
                  &lt;artifactId&gt;google-api-services-storage&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
                  &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
                  &lt;artifactId&gt;httpcore&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.api&lt;/groupId&gt;
                  &lt;artifactId&gt;gax&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;com.google.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;google-cloud-storage&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.code.findbugs&lt;/groupId&gt;
          &lt;artifactId&gt;jsr305&lt;/artifactId&gt;
          &lt;version&gt;3.0.2&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;debug&gt;true&lt;/debug&gt;
                  &lt;parameters&gt;true&lt;/parameters&gt;
                  &lt;annotationProcessorPaths&gt;
                      &lt;path&gt;
                          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                          &lt;artifactId&gt;spring-boot-configuration-processor&lt;/artifactId&gt;
                          &lt;version&gt;2.1.5.RELEASE&lt;/version&gt;
                      &lt;/path&gt;
                  &lt;/annotationProcessorPaths&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;           
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>And my controller</p>
  
  <pre><code>    import org.springframework.http.HttpStatus;
      import org.springframework.web.bind.annotation.CrossOrigin;
      import org.springframework.web.bind.annotation.PostMapping;
      import org.springframework.web.bind.annotation.RequestBody;
      import org.springframework.web.bind.annotation.ResponseStatus;
      import org.springframework.web.bind.annotation.RestController;
  
      import reactor.core.publisher.Mono;
  
      @RestController
      @CrossOrigin
      public class RegistryController {
  
          private final FcmClient fcmClient;
  
          public RegistryController(FcmClient fcmClient) {
              this.fcmClient = fcmClient;
          }
  
          @PostMapping("/register")
          @ResponseStatus(HttpStatus.NO_CONTENT)
          public Mono&lt;Void&gt; register(@RequestBody Mono&lt;String&gt; token) {
              return token.doOnNext(t -&gt; this.fcmClient.subscribe("chuck", t)).then();
          }
  
      }
  </code></pre>
  
  <p>Could you also explain to me how the creation of a WebClient occurs at all when Spring application is created by this line?</p>
  
  <pre><code>SpringApplication.run(MetricPushingApplication.class, args);
  </code></pre>