The NullPointerException
doesn't occur when a single request is made. But when I make a series of requests to the same API - around 1000, at around the 601st request, the connection fails and the exception trace is printed. Someone please help me with it. I've been trying to debug it, but I am unable to get the root cause.
java.lang.NullPointerException
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:468) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1340) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1315) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:264) at com.mytest.TestApplication.httpclient.Request.call(Request.java:143) at com.mytest.TestApplication.httpclient.Request.call(Request.java:37) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)