Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.
07-18 18:57:24.687: W/System.err(7031): java.net.SocketTimeoutException: Read timed out
07-18 18:57:24.773: W/System.err(7031):     at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(NativeMethod)
07-18 18:57:24.773: W/System.err(7031):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:675)
07-18 18:57:24.773: W/System.err(7031):     at libcore.io.Streams.readSingleByte(Streams.java:41)
07-18 18:57:24.773: W/System.err(7031):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:659)
07-18 18:57:24.773: W/System.err(7031):     at libcore.io.Streams.readAsciiLine(Streams.java:201)
07-18 18:57:24.773: W/System.err(7031):     at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
07-18 18:57:24.773: W/System.err(7031):     at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
07-18 18:57:24.773: W/System.err(7031):     at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
07-18 18:57:24.773: W/System.err(7031):     at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)
07-18 18:57:24.773: W/System.err(7031):     at libcore.net.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:271)
07-18 18:57:24.773: W/System.err(7031):     at com.Webservice.downloadFileAddPassword(Webservice.java:192)
07-18 18:57:24.777: W/System.err(7031):     at com.patientcontext.DocumentViewerActivity2$DocumentsShowAsyncTask.doInBackground(DocumentViewerActivity2.java:219)
07-18 18:57:24.777: W/System.err(7031):     at com.patientcontext.DocumentViewerActivity2$DocumentsShowAsyncTask.doInBackground(DocumentViewerActivity2.java:1)
07-18 18:57:24.777: W/System.err(7031):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
07-18 18:57:24.777: W/System.err(7031):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-18 18:57:24.777: W/System.err(7031):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-18 18:57:24.777: W/System.err(7031):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
07-18 18:57:24.781: W/System.err(7031):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-18 18:57:24.785: W/System.err(7031):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-18 18:57:24.785: W/System.err(7031):     at java.lang.Thread.run(Thread.java:856)

Why do i get this exception when i try to connect to the web-service. I search in stack overflow for relevant errors but could not actually figure out why?

share|improve this question
    
Instead of using an asyntask AsyncTasks should ideally be used for short operations (a few seconds at the most.) AsyncTasks API docs. Why don't you use a Service or Downloadmanager? About your exception let's see what people say :) – AlexBcn Jul 18 '13 at 13:49

1 Answer 1

up vote -1 down vote accepted

I'm going to assume that "com.Webservice.downloadFileAddPassword" is the package you created, and your web-service is Webservice.java. If this is true then you are having an error on line 192 of your Webservice.java. Its not that you may not be hitting the web-service, but the operation time or a process inside your web-service is timing out. Did you unit test your web-service?

I am reading in the stacktrace that you have an InputStream that you are calling which when trying to connect or read from the source, it is taking too long at which point it times out. http://docs.oracle.com/javase/7/docs/api/java/net/SocketTimeoutException.html

So basically: webservice is using an input stream that is taking too long. I don't think I know enough to just look at your stacktrace and give any more information.

Stack Trace as a more readable format:

07-18 18:57:24.687: W/System.err(7031): java.net.SocketTimeoutException: Read timed out 
07-18 18:57:24.773: W/System.err(7031): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method) 
07-18 18:57:24.773: W/System.err(7031): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:675) 
07-18 18:57:24.773: W/System.err(7031): at libcore.io.Streams.readSingleByte(Streams.java:41) 
07-18 18:57:24.773: W/System.err(7031): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:659) 
07-18 18:57:24.773: W/System.err(7031): at libcore.io.Streams.readAsciiLine(Streams.java:201) 
07-18 18:57:24.773: W/System.err(7031): at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560) 
07-18 18:57:24.773: W/System.err(7031): at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813) 
07-18 18:57:24.773: W/System.err(7031): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274) 
07-18 18:57:24.773: W/System.err(7031): at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168) 
07-18 18:57:24.773: W/System.err(7031): at libcore.net.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:271) 
07-18 18:57:24.773: W/System.err(7031): at com.Webservice.downloadFileAddPassword(Webservice.java:192) 
07-18 18:57:24.777: W/System.err(7031): at com.patientcontext.DocumentViewerActivity2$DocumentsShowAsyncTask.doInBackground(DocumentViewerActivity2.java:219) 
07-18 18:57:24.777: W/System.err(7031): at com.patientcontext.DocumentViewerActivity2$DocumentsShowAsyncTask.doInBackground(DocumentViewerActivity2.java:1) 
07-18 18:57:24.777: W/System.err(7031): at android.os.AsyncTask$2.call(AsyncTask.java:287) 
07-18 18:57:24.777: W/System.err(7031): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 
07-18 18:57:24.777: W/System.err(7031): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 
07-18 18:57:24.777: W/System.err(7031): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 
07-18 18:57:24.781: W/System.err(7031): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 
07-18 18:57:24.785: W/System.err(7031): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 
07-18 18:57:24.785: W/System.err(7031): at java.lang.Thread.run(Thread.java:856)
share|improve this answer
    
No. The SSL handshake is timing out. See the stack trace. – EJP Jul 19 '13 at 0:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.