是什么导致我的java.nett.ocketException:连接重置?我们看到了频繁但断断续续的情况。java.net.SocketException: Connection reset我们日志中的错误。我们不确定Connection reset错误实际上来自,以及如何进行调试。这个问题似乎与我们试图发送的消息无关。注意,消息是不 connection reset by peer.对于这一例外的典型原因,以及我们如何处理,有什么建议吗?下面是一个典型的堆栈跟踪(com.companyname.mtix.sms是我们的组成部分): java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)我们的组件是一个运行在Tomcat下的Web应用程序,它调用第三方Web服务来发送SMS消息,这是偶然的。抛出异常的代码行是下面代码段中的最后一行。String aggregatorResponse = null;HttpClient httpClient = prepareHttpClient( username, password );
PostMethod postMethod = preparePostMethod( textUrl );try {
SybaseTextMessageBuilder builder = new SybaseTextMessageBuilder();
URL notifyUrl = buildNotificationUrl( textMessage, codeSetManager );
String smsRequestDocument = builder.buildTextMessage( textMessage, notifyUrl );
LOG.debug( "Sybase MT document created as: \n" + smsRequestDocument );
postMethod.setRequestEntity( new StringRequestEntity( smsRequestDocument ) );
LOG.debug( "commiting SMS to aggregator: " + textMessage.toString() );
int httpStatus = httpClient.executeMethod( postMethod );
3 回答

白衣染霜花
TA贡献1796条经验 获得超10个赞
引发,以指示基础协议中存在错误,例如tcp错误。

蛊毒传说
TA贡献1895条经验 获得超3个赞
java.net.SocketException reset by peer
HttpClient

HUX布斯
TA贡献1876条经验 获得超6个赞
转到管理控制台 导航到“配置”->“服务器配置”->“线程池”->“HTTP-线程-池”。 将“最大线程池大小”从5更改为32 将“Min线程池大小”从2更改为16 重启玻璃鱼。
添加回答
举报
0/150
提交
取消