title: Already value [org.springframework.orm.jpa.EntityManagerHolder@64fcf46a] for key bound to thread when making a request using webflux but not using JPA
body: <p>I am new to webflux and I am trying to create a controller using Mono. Problem is, when I try to return a Mono, I get the exception below.</p>
  <blockquote>
  <p>Already value [org.springframework.orm.jpa.EntityManagerHolder@64fcf46a] for key [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@21708736] bound to thread [http-nio-8080-exec-2]</p>
  </blockquote>
  <p>Here is the code snippet which causes the problem.</p>
  <p>Controller</p>
  <pre><code>@RestController
  @Slf4j
  @Getter(AccessLevel.PRIVATE)
  @RequestMapping(ConsultaCNDRoutes.CONSULTA_CND_BASE_ROUTE)
  public class ConsultaCNDRest extends RestControllerAuditedBase {
  
      private ConsultaCNDService consultaCNDService;
      
      @Autowired
      public ConsultaCNDRest(ConsultaCNDService consultaCNDService) {
          this.consultaCNDService = consultaCNDService;
      }
      
      @ApiOperation(&quot;Checa a disponibilizacao do servico&quot;)
      @GetMapping(value = ConsultaCNDRoutes.CONSULTA_CND_STATUS_ROUTE,
              produces = &quot;application/json&quot;)
      public Mono&lt;String&gt; checarServicoConsultaCND() {
          try {
              Mono&lt;String&gt; status = consultaCNDService.consultarServicoCNDStatus();
              return status;
          } catch (CNDServicoNaoDisponivelException e) {
              log.error(e.getMessage());
              return Mono.just(e.getMessage());
          }
      }
      
  }
  </code></pre>
  <p>Service</p>
  <pre><code>@Service
  @Slf4j
  @Getter(AccessLevel.PRIVATE)
  public class ConsultaCNDServiceImpl implements ConsultaCNDService {
  
      @Value(&quot;${serpro.acesso.token}&quot;)
      private String token;
  
      private WebClientService webClientService;
      private CertidaoCNDService certidaoCNDService;
      
      @Autowired
      public ConsultaCNDServiceImpl(WebClientService webClientService, CertidaoCNDService certidaoCNDService) {
          this.webClientService = webClientService;
          this.certidaoCNDService = certidaoCNDService;
      }
      
      @Override
      public Mono&lt;String&gt; consultarServicoCNDStatus() {
          return Mono.just(&quot;HAHAHAHAHAHAHAHAHAHAHAHAHAHA&quot;); //webClientService.getRequest(SerproRoutes.CNDRoutes.STATUS_ROUTE, token);
      }
  
      @Override
      public CertidaoCNDResponse consultarCertidaoCND(ConsultaCertidaoCNDRequest request) {
          // TODO Auto-generated method stub
          return null;
      }
  
  }
  </code></pre>
  <p>WebClient</p>
  <pre><code>@Override
  public Mono&lt;String&gt; getRequest(String url, String token) {
      RequestHeadersSpec&lt;?&gt; responseSpec = client.get().uri(url).header(&quot;Authorization&quot;, token);
      
      Mono&lt;String&gt; serviceResponse = responseSpec.exchangeToMono(r -&gt; {
          if (r.statusCode().equals(HttpStatus.OK)) {
              return r.bodyToMono(String.class);
          } else {
              return r.createException().flatMap(Mono::error);
          }
      });
      
      return serviceResponse;
  }
  </code></pre>
  <p>Note that there is no reference to anything JPA in these, but we use JPA and Hibernate for persistency. What am I doing wrong?</p>