title: Spring controller is not supporting ServerHttpRequest
body: <p>I am using ServerHttpRequest as the request parameter in my Rest Controller. But in the response I'm getting error as "No primary or default constructor found for interface org.springframework.http.server.reactive.ServerHttpRequest".</p>
  
  <p>I found one similar <a href="https://stackoverflow.com/questions/53615945/spring-webflux-annotated-rest-controller-doesnt-support-serverhttprequest-as-me">question</a>,  but no luck. </p>
  
  <p>Rest Controller</p>
  
  <pre>
  @GetMapping(path = "/**")
  public Mono &ltResponseEntity&lt String&gt&gt clientRequests(ServerHttpRequest request) {
      Mono&ltResponseEntity&ltString&gt&gt jsonOp =  restServices.getApiResponse();
      return jsonOp;
  }
  </pre>    
  
  <p>Log</p>
  
  <pre>
  
  SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: No primary or default constructor found for interface org.springframework.http.server.reactive.ServerHttpRequest] with root cause
  java.lang.NoSuchMethodException: org.springframework.http.server.reactive.ServerHttpRequest.()
      at java.lang.Class.getConstructor0(Class.java:3082)
      at java.lang.Class.getDeclaredConstructor(Class.java:2178)
      at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.createAttribute(ModelAttributeMethodProcessor.java:216)
      at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.createAttribute(ServletModelAttributeMethodProcessor.java:84)
      at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:139)
      at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:126)
      at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:166)
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  
      </pre>
  
  <p>Pom.xml</p>
  
  <pre>
  
  &ltdependencies&gt
          &ltdependency&gt
              &ltgroupId&gtorg.springframework.boot&lt/groupId&gt
              &ltartifactId&gtspring-boot-starter-webflux&lt/artifactId&gt
              &ltversion&gt${spring-boot.version}&lt/version&gt
              &ltexclusions&gt
                  &ltexclusion&gt
                      &ltgroupId&gtorg.springframework.boot&lt/groupId&gt
                      &ltartifactId&gtspring-boot-starter-logging&lt/artifactId&gt
                  &lt/exclusion&gt
              &lt/exclusions&gt
          &lt/dependency&gt
          &ltdependency&gt
              &ltgroupId&gtorg.springframework.boot&lt/groupId&gt
              &ltartifactId&gtspring-boot-starter-web&lt/artifactId&gt
              &ltversion&gt${spring-boot.version}&lt/version&gt
              &ltexclusions&gt
                  &ltexclusion&gt
                      &ltgroupId&gtorg.springframework.boot&lt/groupId&gt
                      &ltartifactId&gtspring-boot-starter-logging&lt/artifactId&gt
                  &lt/exclusion&gt
              &lt/exclusions&gt
          &lt/dependency&gt
  
          &ltdependency&gt
              &ltgroupId&gtio.projectreactor.netty&lt/groupId&gt
              &ltartifactId&gtreactor-netty&lt/artifactId&gt
              &ltversion&gt${reactor-netty.version}&lt/version&gt
          &lt/dependency&gt
      &lt/dependencies&gt
  
  </pre>
  
  <p>Versions:</p>
  
  <pre>
  
      &ltspring-boot.version&gt2.1.4.RELEASE&lt/spring-boot.version&gt
      &ltreactor-netty.version&gt0.8.6.RELEASE&lt/reactor-netty.version&gt
  
  </pre>