Windows and Linux deploy the same jar package to push the DingTalk robot alarm message. Windows pushes the message normally, but linux throws an exception java.net.SocketException: Connection reset

**Problem phenomenon:** Because the jar package is migrated from the windows machine to the linux machine, the jar execution exception occurs as follows: java.net.SocketException: Connection reset

At the same time, there are Chinese garbled codes pushed to the DingTalk group.

**The reason is: **When setting the conn connection attribute of the facility, it is caused by setting user-agent to fiddler.

Process processing:
The Linux system executes as follows:
Insert image description here

The normal execution on Windows is as follows:

Insert image description here

This part sends the DingTalk robot alarm code as follows:

Original copy:
Insert image description here

An exception is thrown according to the error message line 63:

Insert image description here
Check the conn connection parameter information and check that the value set by user-agent is fiddler, so modify it here.

The code is adjusted to:
Insert image description here

It has been tested that after Linux deployment, it can be pushed to the DingTalk robot normally.

Guess you like

Origin blog.csdn.net/weixin_40012925/article/details/126316343