4 Replies Latest reply on Jun 15, 2015 2:04 PM by rareddy

    Unable to get REST Webservice response

    bsl.lacerda

      Hi,

       

      I'm trying to expose a REST Webservice on JBoss Data Virtualization 6 but when I invoke the service from the teiid webservice test page from the generated .war I'm getting the following error:

       

      18:14:24,622 WARN  [org.jboss.resteasy.core.SynchronousDispatcher] (http-/192.168.0.14:8080-4) Failed executing GET /IcsEnergiaViewModel/get/: org.jboss.resteasy.spi.WriterException: ClientAbortException:  java.net.SocketException: Software caused connection abort: socket write error

          at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:262) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:616) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:528) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

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

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

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

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

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

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

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

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

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

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

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

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

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

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

      Caused by: ClientAbortException:  java.net.SocketException: Software caused connection abort: socket write error

          at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:426) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:450) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:295) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.catalina.connector.OutputBuffer.writeByte(OutputBuffer.java:467) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:78) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper$DeferredOutputStream.write(HttpServletResponseWrapper.java:34) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.util.CommitHeaderOutputStream.write(CommitHeaderOutputStream.java:57) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.providers.InputStreamProvider.writeTo(InputStreamProvider.java:62) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.providers.InputStreamProvider.writeTo(InputStreamProvider.java:22) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:117) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.providers.jackson.JacksonJsonpInterceptor.write(JacksonJsonpInterceptor.java:112) [resteasy-jackson-provider-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:123) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.write(GZIPEncodingInterceptor.java:104) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:123) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:250) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          ... 20 more

      Caused by: java.net.SocketException: Software caused connection abort: socket write error

          at java.net.SocketOutputStream.socketWrite0(Native Method) [rt.jar:1.7.0_60]

          at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) [rt.jar:1.7.0_60]

          at java.net.SocketOutputStream.write(SocketOutputStream.java:159) [rt.jar:1.7.0_60]

          at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:706) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:450) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:351) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:730) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:126) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:543) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.coyote.Response.doWrite(Response.java:594) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:421) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          ... 34 more

       

      18:14:24,627 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/fv-ics-energia].[RestDataservice]] (http-/192.168.0.14:8080-4) JBWEB000236: Servlet.service() for servlet RestDataservice threw exception: java.lang.IllegalStateException

          at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:392) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:109) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.handleFailure(SynchronousDispatcher.java:284) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.handleWriterException(SynchronousDispatcher.java:418) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:238) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.handleWriteResponseException(SynchronousDispatcher.java:222) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:532) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]

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

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

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

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

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

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

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

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

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

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

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

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

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]

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

       

      Does someone can give me some tips about what should be the mistake?

       

      Thanks in advance.

        • 1. Re: Unable to get REST Webservice response
          shawkins

          Are there any logs from the Teiid log related to this exception?  Are there any requests against this or other services that executed successfully?

          • 2. Re: Unable to get REST Webservice response
            bsl.lacerda

            Hi Steven,

             

            "logs from the Teiid log"?

            I dont know any log files related only to teiid classes. Should I debug some teiid category to get more details? If so, which are?

             

            "Are there any requests against this or other services that executed successfully?"

            No, I'm following this blog Generating Web Services for View Models in JBoss Data Virtualization 6.1 – Everything JBoss as reference. The unique diference is that I'm using a flat file source instead a JDBC source.

             

            Regards,

            Bruno Lacerda

            • 3. Re: Unable to get REST Webservice response
              bsl.lacerda

              Hi,

               

              some more information that can help is:

               

              When I try to start the server using the default binding configuration that target localhost (127.0.0.1), the server starts but the following error occurs:

               

              Obs.: I changed the port number 31000 to 32000, but the problem still happen.

               

              10:47:13,838 INFO  [org.teiid.RUNTIME] (MSC service thread 1-7) TEIID50037 Teiid ODBC - Name = odbc, Host = MY-PC.mydomain.com.br,  Port = 35432, SSL = OFF, security-domains = teiid-security

              10:47:13,839 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.teiid.transport.jdbc: org.jboss.msc.service.StartException in service jboss.teiid.transport.jdbc: Failed to start service

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1936) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]

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

              Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: MY-PC.mydomain.cm.br/127.0.0.1:32000

                      at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)

                      at org.teiid.transport.SocketListener.<init>(SocketListener.java:96)

                      at org.teiid.transport.SocketListener.<init>(SocketListener.java:54)

                      at org.teiid.jboss.TransportService.start(TransportService.java:155)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

                      ... 3 more

              Caused by: java.net.BindException: Address already in use: bind

                      at sun.nio.ch.Net.bind0(Native Method) [rt.jar:1.7.0_60]

                      at sun.nio.ch.Net.bind(Net.java:444) [rt.jar:1.7.0_60]

                      at sun.nio.ch.Net.bind(Net.java:436) [rt.jar:1.7.0_60]

                      at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) [rt.jar:1.7.0_60]

                      at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) [rt.jar:1.7.0_60]

                      at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)

                      at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:382)

                      at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:306)

                      at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)

                      ... 3 more

               

              Is it normal to have MY-PC.mydomain.cm.br/127.0.0.1:32000 as binding mapping in this case? I think only 127.0.0.1 would be enough.

               

              Other information is, if I start the server and my pc is connected to the neg and got a Dynamic IP from DHCP, even if I put all interfaces ti bind to 127.0.0.1, the server starts pointing to the Dynamic IP.

               

              Obs.: Starting the server from JBDS or starting from the command line, this behavior is the same.

               

              One more information:

               

              To start the server without problems, I have to change the "hosts" net configuration file to bind my dynamic IP to localhost, And I think that this can be causing the "java.net.SocketException: Software caused connection abort: socket write error" on calling the REST service response.

               

              Sorry for my english mistakes.

              • 4. Re: Unable to get REST Webservice response
                rareddy

                It should be fine binding to 127.0.0.1 address, I suspect there is something else with causing this issue. However, it is external to Teiid.