1 Reply Latest reply on May 10, 2016 3:17 AM by Sendhil Chokkalingam

    JAX RS - AsyncResponse throwing Could not find message body reader for type: interface javax.ws.rs.container.AsyncResponse

    Sendhil Chokkalingam Newbie

      I have a very simple JAX RS method - see the signature below

       

      @POST

      @Path("/services/async")

      public void asyncCall(String request, @Suspended final AsyncResponse  asyncResponse) {

       

      }

       

      web.xml

      <web-app>

      <servlet>

        <servlet-name>resteasy-servlet</servlet-name>

        <servlet-class>

        org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher

                      </servlet-class>

        <init-param>

        <param-name>javax.ws.rs.Application</param-name>

        <param-value>com.test.ResourceApplication</param-value>

        </init-param>

        </servlet>

       

       

        <servlet-mapping>

        <servlet-name>resteasy-servlet</servlet-name>

        <url-pattern>/*</url-pattern>

        </servlet-mapping>

       

        <context-param>

        <param-name>resteasy.scan</param-name>

        <param-value>false</param-value>

        </context-param>

        <context-param>

        <param-name>resteasy.scan.providers</param-name>

        <param-value>false</param-value>

        </context-param>

        <context-param>

        <param-name>resteasy.scan.resources</param-name>

        <param-value>false</param-value>

        </context-param>

      </web-app>

       

      Dependencies

       

      <dependency>

                  <groupId>org.jboss.resteasy</groupId>

                  <artifactId>resteasy-jaxrs</artifactId>

                  <version>${resteasy.version}</version>

              </dependency>

              <dependency>

                  <groupId>org.jboss.resteasy</groupId>

                  <artifactId>resteasy-client</artifactId>

                  <version>${resteasy.version}</version>

              </dependency>

              <dependency>

                  <groupId>org.jboss.resteasy</groupId>

                  <artifactId>resteasy-jaxb-provider</artifactId>

                  <version>${resteasy.version}</version>

              </dependency>

              <dependency>

                  <groupId>org.jboss.resteasy</groupId>

                  <artifactId>async-http-servlet-3.0</artifactId>

                  <version>${resteasy.version}</version>

              </dependency>

       

      Accessing the resource the following exception

       

      19:26:19,380 SEVERE [org.jboss.resteasy.core.SynchronousDispatcher] (localhost/192.168.1.9:8080-2) Failed executing POST /test/

      services/async: org.jboss.resteasy.spi.BadRequestException: Could not find message body reader for type: interface javax.ws.rs.container.AsyncResponse of conten

      t type: text/plain

              at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:153) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:136) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:159) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.5.Final.jar:]

              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.5.Final.jar:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.0.Final.jar:7.2.0.Final]

              at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.0.Final.jar:7.2.0.Final]

              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final.jar:7.2.0.Final]

              at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_60]

       

      Could someone help, thanks in advance