3 Replies Latest reply on Feb 10, 2017 10:02 AM by lcampbell

    I/O exception while consuming v3 service

    lcampbell

      Hi,

       

      Am getting below timeout error from my application which is written using Spring MVC framework. This application consumes Jive V3 service for data from Jive.

      I see the below error in my logs very frequent. Please suggest what might be the cause for this error.

       

      2017-02-03 02:24:13 [] INFO  RetryExec:96 - I/O exception (java.net.SocketException) caught when processing request to {s}->https://XXXX.jiveon.com:443: Connection reset

      2017-02-03 02:24:13 [] INFO  RetryExec:96 - I/O exception (java.net.SocketException) caught when processing request to {s}->https://XXXX.jiveon.com:443: Connection reset

      2017-02-03 02:24:13 [] INFO  RetryExec:96 - I/O exception (java.net.SocketException) caught when processing request to {s}->https://XXXX.jiveon.com:443: Connection reset

      2017-02-03 02:24:14 [] INFO  RetryExec:112 - Retrying request to {s}->https://XXXX.jiveon.com:443

      2017-02-03 02:24:14 [] INFO  RetryExec:112 - Retrying request to {s}->https://XXXX.jiveon.com:443

      2017-02-03 02:24:15 [] INFO  RetryExec:112 - Retrying request to {s}->https://XXXX.jiveon.com:443

      2017-02-03 02:24:22 [] INFO  RetryExec:96 - I/O exception (java.net.SocketException) caught when processing request to {s}->https://XXXX.jiveon.com:443: Unrecognized Windows Sockets error: 0: recv failed

      2017-02-03 02:24:22 [] INFO  RetryExec:112 - Retrying request to {s}->https://XXXX.jiveon.com:443

      2017-02-03 02:24:22 [] INFO  RetryExec:96 - I/O exception (java.net.SocketException) caught when processing request to {s}->https://XXXX.jiveon.com:443: Connection reset by peer: socket write error

      2017-02-03 02:24:22 [] INFO  RetryExec:112 - Retrying request to {s}->https://XXXX.jiveon.com:443

       

       

       

      Ryan Rutan Pawan Shah - Any inputs will be helpful.

        • Re: I/O exception while consuming v3 service

          Can you provide a full dump of the headers, the endpoint, obfuscated host and authorization tokens so that we can try it out? You can message the tokens to me if you want.

          • Re: I/O exception while consuming v3 service
            lcampbell

            I get the socket timeout for avatar request

            https://xxxx.jiveon.com/api/core/v3/people/2821/avatar?a=1282

            and activities request

             

            https://xxxx.jiveon.com/api/core/v3/contents?sort=latestActivityDesc&includeBlogs=true&fields=author,replyCount,likeCount,subject,content,contentID,parentPlace,lastActivity,-resources

             

            Headers - From middleware layer am passing only basic auth header and X-Jive-Run-As which is configured to use the username.

            • Re: I/O exception while consuming v3 service
              lcampbell

              protected final RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(5000).build();

              final HttpGet avatarRequest = new HttpGet(url);

              avatarRequest.setConfig(requestConfig);

              avatarRequest.addHeader(new BasicHeader(HttpHeaders.AUTHORIZATION, ""));

              final HttpResponse avatarImgResponse = HttpClients.createMinimal().execute(avatarRequest);

              avatarStream = avatarImgResponse.getEntity().getContent();

               

              Stacktrace

               

              org.apache.http.conn.ConnectTimeoutException: Connect to xxxx.jiveon.com:443 [xxxx.jiveon.com/104.114.67.202] failed: Read timed out

                at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:150)

                at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)

                at org.apache.http.impl.execchain.MinimalClientExec.execute(MinimalClientExec.java:183)

                at org.apache.http.impl.client.MinimalHttpClient.doExecute(MinimalHttpClient.java:107)

                at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)

                at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)

                at com.csuite.middleware.jive.service.IndexService.getAvatar(IndexService.java:66)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:606)

                at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)

                at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)

                at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)

                at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:743)

                at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:672)

                at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:82)

                at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)

                at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)

                at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)

                at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

                at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at com.csuite.CORSFilter.doFilter(CORSFilter.java:41)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)

                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)

                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                at java.lang.Thread.run(Thread.java:745)

              Caused by: java.net.SocketTimeoutException: Read timed out

                at java.net.SocketInputStream.socketRead0(Native Method)

                at java.net.SocketInputStream.read(SocketInputStream.java:152)

                at java.net.SocketInputStream.read(SocketInputStream.java:122)

                at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)

                at sun.security.ssl.InputRecord.read(InputRecord.java:480)

                at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)

                at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)

                at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)

                at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)

                at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)

                at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)

                at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)

                ... 42 more

              2017-01-09 19:00:59 INFO  RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {s}->https://xxxx.jiveon.com:443: The target server failed to respond

              2017-01-09 19:00:59 INFO  RetryExec:112 - Retrying request to {s}->https://xxxxx.jiveon.com:443