Provide any suggestions to resolve this issue.
NOTE: Environment is fixed. No upgrades will happen at this time. Just resolve the issue.
Application Server: WebSphere 7
Java version: 1.6.0.161
OS: Solaris
Experiencing "Connection Reset" error message while open the HTTPS connection in java code
Code Snippet:
String json = mattArray.toString().trim();
URL url = new URL(https_url);
HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
conn.setConnectTimeout(5000);
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestMethod("POST");
OutputStream os = conn.getOutputStream(); --> Error triggering at this line
os.write(json.getBytes("UTF-8"));
os.close();
Error Message
2020-02-07 10:51:14,190 [system] [DEBUG] [rule] SendMatter.log - ERROR2 :java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at com.ibm.jsse2.a.a(a.java:148)
at com.ibm.jsse2.a.a(a.java:96)
at com.ibm.jsse2.tc.a(tc.java:302)
at com.ibm.jsse2.tc.g(tc.java:208)
at com.ibm.jsse2.tc.a(tc.java:482)
at com.ibm.jsse2.tc.startHandshake(tc.java:597)
at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:44)
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:36)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1014)
at com.ibm.net.ssl.www2.protocol.https.b.getOutputStream(b.java:66)
at A087049_SendMattertoLegalHoldProLA.doAction(A087049_SendMattertoLegalHoldProLA.java:583)
at A087049_SendMattertoLegalHoldProLA$1.call(A087049_SendMattertoLegalHoldProLA.java:85)
at com.mitratech.teamconnect.base.factory.FQUtility.runAsSystemUser(FQUtility.java:703)
at com.mitratech.teamconnect.entity.factory.FNUtility.runAsSystemUser(FNUtility.java:488)
at A087049_SendMattertoLegalHoldProLA.action(A087049_SendMattertoLegalHoldProLA.java:83)
at com.mitratech.teamconnect.base.factory.FQAppvEngine.executeAutomatedAction(FQAppvEngine.java:5832)
at com.mitratech.teamconnect.base.factory.TCAutomatedActionJob$1.call(TCAutomatedActionJob.java:106)
at com.mitratech.teamconnect.base.factory.FQUtility.runAsSystemUser(FQUtility.java:703)
at com.mitratech.teamconnect.base.factory.FQUtility.runAsSystemUserInDomain(FQUtility.java:671)
at com.mitratech.teamconnect.base.factory.TCAutomatedActionJob.execute(TCAutomatedActionJob.java:48)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)