`

java.net.SocketException, underlying cause: Software caused connection abort: re

阅读更多

web程序发布在tomat6下,程序使用spring3+hebernate3+struts2,数据库mysql5


连续刷新页面导致

java.sql.SQLException
MESSAGE: Communication link failure: java.net.SocketException, underlying cause: Software caused connection abort: recv failed


Following scenario fully reproduces the problem with clear Sockets:
1) Client -> Server: client sends request chunk#1
2) Server -> Client: server reads chunk#1, processes, writes response
3) Server closes connection
4) Client -> Server: client sends request chunk#2
5) Client tries to read server response: "java.net.SocketException: Software caused connection abort: recv failed"

As the result client will not be able to read any byte from server's response!
What is interesting on step (4) we don't see any exception, but this step (sending data over connection, which is closed by peer) is the reason of the exception we're getting on (5). Removing step (4) from our scenario, or putting it before step (3) - makes everything work.


对于webApp程序来说 这样错误并不严重

有一种解决方法,不彻底,就是删除tomcat下web.xml里面的过滤器,该过滤器为

  <filter>

    <filter-name>HTTPMonitorFilter</filter-name>

    <filter-class>org.netbeans.modules.web.monitor.server.MonitorFilter</filter-class>

    <init-param>

      <param-name>netbeans.monitor.ide</param-name>

      <param-value>127.0.0.1:8082</param-value>

    </init-param>

  </filter>

  <filter-mapping>

    <filter-name>HTTPMonitorFilter</filter-name>

    <url-pattern>/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>ERROR</dispatcher>

  </filter-mapping>

分享到:
评论

相关推荐

    JAVA.NET.SOCKETEXCEPTION TOO MANY OPEN FILES解决方法

    JAVA.NET.SOCKETEXCEPTION TOO MANY OPEN FILES解决方法 JAVA.NET.SOCKETEXCEPTION TOO MANY OPEN FILES错误是一种常见的网络编程错误,发生在Java应用程序中, especialmente 在 Linux 操作系统中。该错误的出现是...

    java.net.SocketException Connection reset 解决方法

    "java.net.SocketException Connection reset 解决方法" 在 Java 编程中,SocketException 是一种常见的异常,特别是在网络编程中。Conexion reset by peer 是一种特殊的 SocketException,它发生在客户端和服务器...

    在Win7系统下抛出java.net.SocketException的解决办法

    ### 在Win7系统下抛出java.net.SocketException的解决办法 #### 问题背景及原因分析 在使用MyEclipse开发工具结合JBoss服务器进行项目开发的过程中,遇到一个常见但令人头疼的问题:当启动JBoss服务器时,控制台...

    java.net.SocketException: No route to host 异常原因

    NULL 博文链接:https://zhoudan241.iteye.com/blog/1432014

    java.net.SocketException: Connection reset 解决方法

    Java中的`java.net.SocketException: Connection reset`是一个常见的网络编程错误,通常表示在TCP/IP通信过程中,连接突然中断。这个异常可能在客户端或服务器端发生,通常与数据传输的异常中断有关。 首先,我们来...

    http接口调用报错.rar

    接口调用报错:java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory

    Java Socket常见异常处理

    4. **java.net.SocketException: (Connection reset 或 Connect reset by peer: Socket write error)** 这两种异常都表示连接已断开。可能的原因是一端关闭了Socket,而另一端仍在尝试读写。处理这类异常需要检测到...

    java.net.SocketException(解决方案).md

    在Java开发中,SocketException是一个常见的网络编程异常,通常是由于网络连接问题、端口资源管理不当、端口冲突或并发线程管理不当等原因引起的。要解决这个问题,可以从以下几个方面入手: 首先,检查网络连接...

    Linux下打开的文件过多错误

    Linux下运行tomcat或者was出现java.net.SocketException: 打开的文件过多错误 tomcat报“too many open files”的错误,解决办法如下:

    connection reset解决方案(亲测可用).md

    connection reset解决方案(亲测可用).md

    Google I/O 2013推荐Android 网络通信框架Volley

    ```java RequestQueue queue = Volley.newRequestQueue(this); ``` 2. 创建Request对象:根据实际需求创建对应的Request子类,如StringRequest、JsonArrayRequest等。 ```java String url = ...

    fastdfs使用java

    在Java中使用FastDFS,首先需要在项目中引入FastDFS的Java客户端库。配置client.conf文件,设置tracker服务器的地址和其他相关参数。接着创建FastdfsClient和FastdfsUtil类,前者用于与FastDFS服务器通信,后者封装...

    C# 服务器发送邮件失败实例分析

    “{“success”:false,”message”:”错误System.Net.Mail.SmtpException: Failure sending mail. —&gt; System.Net.WebException: The remote name could not be resolved: ‘smtp.163.com’ 分析: 邮件发送相关...

    System.SR.dll 无法显示错误信息

    System.Net.WebException: 无法显示错误消息,原因是无法找到包含此错误消息的可选资源程序集 ---&gt; System.Net.Sockets.SocketException: 无法显示错误消息,原因是无法找到包含此错误消息的可选资源程序集 ...

    Ice-3.7.4.msi for windows版

    Caused by: java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574) at ...

    java网络编程示例

    import java.net.SocketException; public class UDPServer { public static void main(String[] args) { try { byte [] buffer = new byte[1024]; DatagramSocket socket = new DatagramSocket(4444); ...

    Windows10/11 USB驱动

    System.Net.Sockets.SocketException (10061): 由于目标计算机积极拒绝,无法连接。 at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken ...

    java中的connection reset 异常处理分析

    在Java编程中,"connection reset"异常通常表示网络连接在数据传输过程中突然中断,这可能是由多种原因导致的。在本文中,我们将深入探讨这种异常的处理和分析,特别是与Java中的Socket通信相关的方面。 首先,`...

    如何解决线程太多导致java socket连接池出现的问题

    3. 错误信息:当Socket连接池出现问题时,可能会出现错误信息,如"java.net.SocketException: No buffer space available (maximum connections reached?): listen failed"。 解决方法 要解决线程太多导致Socket...

Global site tag (gtag.js) - Google Analytics