java swing上做socket 通信抛异常java.net.SocketException: Connection reset 自己搞了一天了都不行 [问题点数:15分,结帖人u012307873]

Bbs1
本版专家分:0
结帖率 89.47%
Bbs1
本版专家分:0
Bbs9
本版专家分:79730
java.net.SocketException Connection reset 解决方法
<em>java</em>.net.SocketException Connection <em>reset</em> 解决方法
java.net.SocketException: Connection reset
问题说明 每次测试客户端和服务器通讯功能以后,肯定要关闭一方程序,一关闭一方的程序就报错! 我属于人为关闭,我知道关闭了会报错,但是我想关闭以后不报这个错误 解决方案 在客户端和服务器的代码里面 只要涉及到会报错/抛出IOException<em>异常</em>的catch块里面添加如下代码,关闭<em>socket</em>,就可以了 ...
Socket java.net.SocketException: Connection reset的解决方案
Socket <em>java</em>.net.SocketException: Connection <em>reset</em>的解决方案 创建了服务器端跟客户端,运行之后报错:Socket <em>java</em>.net.SocketException: Connection <em>reset</em> 服务端代码为: public class JobWork05 { public static void main(String[] args) { tr...
【转】Socket网络编程的一些常见异常
第1个<em>异常</em>是<em>java</em>.net.BindException:Address already in use: JVM_Bind。该<em>异常</em>发生在服务器端进行new ServerSocket(port)(port是一个0,65536的整型值)操作时。<em>异常</em>的原因是以为与port一样的一个端口已经被启动,并进行监听。此时用netstat –an命令,可以看到一个Listending状态的端口。只需要找一个没有被...
apache FTPClient 操作出现java.net.SocketException: Connection reset by peer: socket write error 踩坑
最近使用了FTP搭建了一个文件服务器 主要用来上传文件 图片等 结果操作ftp的时候爆出了: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write error 这个错误不是一开始就爆出来了 后来测试的时候才发现 很蛋疼的一个东西(后面有说为什么说他蛋疼!!!) 过程: 一开始就是ftp的搭建  我这里使用了是wi...
java.net.SocketException: Connection reset by peer
<em>socket</em>客户端总<em>异常</em>,不知道怎么解决
ClientAbortException: java.net.SocketException: Connection reset
高手们帮我看看怎么解决?rn我用的是Tomcat6rnrnrnrnClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em>rn at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.<em>java</em>:358)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.<em>java</em>:354)rn at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.<em>java</em>:381)rn at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.<em>java</em>:370)rn at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.<em>java</em>:89)rn at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.<em>java</em>:1708)rn at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.<em>java</em>:809)rn at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.<em>java</em>:325)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:617)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at net.<em>java</em>to.framework.filter.PersistenceFilter.doFilter(PersistenceFilter.<em>java</em>:63)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at net.<em>java</em>to.framework.filter.RequestFilter.continueFilter(RequestFilter.<em>java</em>:295)rn at net.<em>java</em>to.framework.filter.RequestFilter.doFilter(RequestFilter.<em>java</em>:167)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.<em>java</em>:96)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.<em>java</em>:75)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.<em>java</em>:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.<em>java</em>:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.<em>java</em>:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.<em>java</em>:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.<em>java</em>:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.<em>java</em>:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.<em>java</em>:845)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.<em>java</em>:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.<em>java</em>:447)rn at <em>java</em>.lang.Thread.run(Thread.<em>java</em>:619)rnCaused by: <em>java</em>.net.SocketException: Connection <em>reset</em>rn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write(SocketOutputStream.<em>java</em>:96)rn at <em>java</em>.net.SocketOutputStream.write(SocketOutputStream.<em>java</em>:136)rn at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.<em>java</em>:740)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.<em>java</em>:434)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.<em>java</em>:349)rn at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.<em>java</em>:764)rn at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.<em>java</em>:118)rn at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.<em>java</em>:573)rn at org.apache.coyote.Response.doWrite(Response.<em>java</em>:560)rn at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.<em>java</em>:353)rn ... 32 more
java.net.SocketException: Connection reset
第1个<em>异常</em>是<em>java</em>.net.BindException:Address already in use: JVM_Bind。该<em>异常</em>发生在服务器端进行new ServerSocket(port)(port是一个0,65536的整型值)操作时。<em>异常</em>的原因是以为与port一样的一个端口已经被启动,并进行监听。此时用netstat –an命令,可以看到一个Listending状态的端口。只需要找一个没有被
关于Socket Connection reset 问题
之前接触<em>socket</em>较少、有个问题想咨询大家一下 谢谢、 <em>异常</em>信息: <em>java</em>.net.SocketException: Connection <em>reset</em> at <em>java</em>.net.SocketInpu
java.net.SocketException: Connection reset问题解决总结
解决办法:   1、网络编程时未正确捕获<em>java</em>.net.SocketException, 客户端先关闭就会报这个<em>异常</em>;(检查发送数据是否符合服务器接收格式,不然的话服务器会自动断开连接,这样,<em>socket</em>就会被关闭,那么你就不能使用IO流读取数据,这样就会报这个错误)   2、数据库和应用服务器的网段不同(这个查看一下,可能性较小)  3、好像说防火墙的比较多。。。。(试一下,关闭)
java.net.SocketException: Connection reset 解决方法
该<em>java</em><em>异常</em>在客户端和服务器端都有可能发生,引起该<em>异常</em>的原因有两个: 1,如果一端的Socket被关闭(或主动关闭,或因为<em>异常</em>退出而 引起的关闭),另一端仍发送数据,发送的第一个数据包引发该<em>异常</em>(Connect <em>reset</em> by peer)。 2,一端退出,但退出时并未关闭该连接,另一端如果在从连接中读数据则抛出该<em>异常</em>(Connection <em>reset</em>)。简单的说就是在连接断开后的读和写操作
java异常java.net.SocketException: Connection reset
<em>java</em>.net.SocketException: Connection <em>reset</em> at <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>:168) at weblogic.servlet.internal.PostInputStream.read(PostInputStream.<em>java</em>:170) at weblogic.ser...
关于:java.net.SocketException: Connection reset
大家好:rn我写了一个网络交易程序,原理按照ibm的<em>socket</em>教程做的,是服务器端使用ServerSocket建立监听,客户端创建Socket进行连接,客户端发送一条信息给服务器,服务器返回一条信息给客户端,然后断开连接。rn开始一切都很好,但目前出现这个问题,当程序运行一段时间后(可能几个小时或10几个小时),当客户端程序向服务端发送信息时,服务器端一开始提示进行有新的连接建立,然后在读<em>socket</em>时抛出例外<em>java</em>.net.SocketException: Connection <em>reset</em>。rn
Caused by: java.net.SocketException: Connection reset
13:50:17,093 WARN com.mchange.v2.resourcepool.BasicResourcePool:1841 - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1c7d56b -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (3). Last acquisition attempt exception: rn<em>java</em>.sql.SQLException: I/O Error: Connection <em>reset</em>rn at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.<em>java</em>:2311)rn at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.<em>java</em>:603)rn at net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.<em>java</em>:357)rn at net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.<em>java</em>:50)rn at net.sourceforge.jtds.jdbc.Driver.connect(Driver.<em>java</em>:184)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.<em>java</em>:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.<em>java</em>:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.<em>java</em>:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.<em>java</em>:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.<em>java</em>:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.<em>java</em>:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.<em>java</em>:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.<em>java</em>:547)rnCaused by: <em>java</em>.net.SocketException: Connection <em>reset</em>rn at <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>:168)rn at <em>java</em>.io.DataInputStream.readFully(DataInputStream.<em>java</em>:178)rn at <em>java</em>.io.DataInputStream.readFully(DataInputStream.<em>java</em>:152)rn at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.<em>java</em>:842)rn at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.<em>java</em>:723)rn at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.<em>java</em>:466)rn at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.<em>java</em>:103)rn at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.<em>java</em>:2206)rn ... 12 morernrnrn/*-----------------------------------------------------------------------------*/rnrn启动服务器时候。报以上错误。用的是SQL Server数据库。
java.net.SocketException: Connection reset错误
<em>java</em>.net.SocketException: Connection <em>reset</em>rn at <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>:189)rn at <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>:121)rn at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.<em>java</em>:283)rn at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.<em>java</em>:325)rn at sun.nio.cs.StreamDecoder.read(StreamDecoder.<em>java</em>:177)rn at <em>java</em>.io.InputStreamReader.read(InputStreamReader.<em>java</em>:184)rn at <em>java</em>.io.BufferedReader.fill(BufferedReader.<em>java</em>:154)rn at <em>java</em>.io.BufferedReader.readLine(BufferedReader.<em>java</em>:317)rn at <em>java</em>.io.BufferedReader.readLine(BufferedReader.<em>java</em>:382)rn at MyClient.doSocket(MyClient.<em>java</em>:41)rn at MyClient.main(MyClient.<em>java</em>:60)rn我向一个指定IP发送报文出现的错误rnpublic class MyClient rn rn public static void doSocket()throws UnknownHostException, IOException rn rn try rn Socket <em>socket</em>=new Socket("127.169.0.0",8888); rn BufferedReader sysin=new BufferedReader(new InputStreamReader(System.in)); rn PrintWriter <em>socket</em>_os=new PrintWriter(<em>socket</em>.getOutputStream()); rn BufferedReader <em>socket</em>_is=new BufferedReader(new InputStreamReader(<em>socket</em>.getInputStream())); rn String readline; rn System.out.print("**Client:"); rn readline=sysin.readLine(); rn System.out.println(""); rn while(!readline.equals("bye")) rn <em>socket</em>_os.println(readline); rn <em>socket</em>_os.flush(); rn System.out.println("**Server:"+<em>socket</em>_is.readLine()); rn System.out.print("**Client:"); rn readline=sysin.readLine(); rn System.out.println(""); rn rn <em>socket</em>_os.close(); rn <em>socket</em>_is.close(); rn <em>socket</em>.close(); rn rn catch (IOException e) rn e.printStackTrace(); rn rn rn rn rnrn public static void main(String[] args) throws UnknownHostException, IOException rn MyClient.doSocket(); rn rn rn rn rn这个是以前在网上找的可用的代码向服务器发送的是rn052060000200006030000000000200702404C030C0rn270000003119070802100006403F39548D09F6A807rnF81B4CBE9594A0CF8C6F57817B0112297BF179EAADrn9F053E54ED5D8B2B8DE8679BC6EFC114B10F9C1246rn8DE8679BC6EFC12B8DE8679EC6EFC199C2E0F892F4rn78FC820CEAC4913232303135393233313233343536rn0A00142212103100311967DE7DA8CE78A215rn本人菜鸟请指点大白话或者代码改哪里~非常感谢[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/1.gif][/img]
错误:java.net.SocketException: Connection reset
客户端控制台提示错误:<em>java</em>.net.SocketException: Connection <em>reset</em> 感觉客户端代码,无法确定服务端文件何时传送结束,造成的错误原因: while((in.rea
Connection reset原因分析和解决方案
为什么80%的码农都做不了架构师?&gt;&gt;&gt; ...
java.net.SocketException: Connection reset 异常处理
场景描述:客户端通过<em>socket</em>访问远程服务器,执行命令时抛<em>异常</em>,  <em>java</em>.net.SocketException: Connection <em>reset</em>  分析:使用<em>socket</em>访问服务端数据时,当服务端认为已经返回全部的结果后,会主动关闭<em>socket</em>,此时客户端再从<em>socket</em>读数据会抛<em>异常</em>。   处理办法: 1.客户端可准确识别返回内容结束标志时,读取全部数据后主动关闭连接。 2....
java.net.SocketException: Connection reset 问题解决方法
<em>java</em>.net.SocketException: Connection <em>reset</em> 问题解决方法 客户端用长连接进行连接,也就是写个死循环,while ture;用 while((temp = inputStream.read(buffer)) != -1){ System.out.println(new String(buffer,0,temp)); } 会...
java.net.SocketException: Connection reset by peer: Connection reset by peer
<em>java</em>.net.SocketException: Connection <em>reset</em> by peer: Connection <em>reset</em> by peer 这个<em>异常</em>是怎么引起的?
java.net.socketexception connection reset
小弟我用<em>java</em>实现了一个联通SGIP发送,接收短信的程序。rn不过在接收过程中,由于联通发送完deliver命令后要间隔16秒才发送unbind命令,此时作为服务器端的我的程序抛出rn<em>java</em>.net.<em>socket</em>exception <em>connection</em> <em>reset</em>错误!rn因为我在接收数据的时候inputstread.read(bytes[])是一个阻塞函数,如果没有接收到输入流就会阻塞住不动,但是错误的信息应该是<em>socket</em>已经断开。所以让我很奇怪,<em>搞了</em>一周也没有解决这个问题,请大伙帮忙啊!
Connection reset异常的一种解决办法
最近压测时,服务端系统出现了“Connection <em>reset</em>”的<em>异常</em>,原因是服务器关闭了Connection[调用了Socket.close()方法]。当检查了应用中没有显示关闭的链接的代码后,调系统内核的参数后压测再无报错: a.进入: vim /etc/sysctl.conf b.添加:net.core.somaxconn=2048 该参数默认为128,根据实际场景调大...
java.net.SocketException: Connection reset解决办法
最近在做电信短信网关的项目时遇到这个问题,当程序初始化请求与服务器连接的时候老报<em>java</em>.net.SocketException: Connection <em>reset</em>错误,就是连不上。询问了用户,配置的
java.net.SocketException: Connection reset问题
<em>java</em>.net.SocketException: Connection <em>reset</em> at <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>
关于 java.net.SocketException: Connection reset错误
今天在客户这边调试程序是:发现老是报下面的2种错误: <em>java</em>.net.SocketException: Connection <em>reset</em> <em>java</em>.net.SocketException: Software caused <em>connection</em> abort: recv failed 运行环境,windows环境,tomcat中跑程序,访问linux服务器的ftp服务器,给ftp上传文件。
Java.net.SocketException:Connection reset
第一眼看到这个<em>异常</em>就顾名思义意识到是个连接的错误,然后就百度一下这个<em>异常</em>是什么原因引起的,简单来说呢就是在连接断开后的读和写操作引起的,再简单一点来说呢就是数据还没传送完,连接就断开了。。。一脸懵逼,无从下手。。。        那么就先来看看什么操作导致出现这个<em>异常</em>的吧,点开一个页面docId是370,数据返回完全正常,好吧,继续打开别的,当docId是374的时候问题来了,每次刷新返
java.net.SocketException: Connection reset by peer: socket write error
[size=18px]我用以下代码实现文件下载:[/size]rnrn[code]rnrnrnrnrn rn rn rn rn rn rn rnrn[/code]rn[size=18px]rn下载doc和txt格式的文件还可以,没有报错,可是下载ppt格式的文件他就报如下错误:[/size]rnrn[code=Java]rn<em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write0(Native Method)rn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write(Unknown Source)rn at <em>java</em>.net.SocketOutputStream.write(Unknown Source)rn at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.<em>java</em>:750)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.<em>java</em>:432)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.<em>java</em>:347)rn at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.<em>java</em>:773)rn at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.<em>java</em>:118)rn at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.<em>java</em>:583)rn at org.apache.coyote.Response.doWrite(Response.<em>java</em>:560)rn at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.<em>java</em>:361)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.<em>java</em>:432)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.<em>java</em>:347)rn at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.<em>java</em>:392)rn at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.<em>java</em>:381)rn at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.<em>java</em>:89)rn at org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.<em>java</em>:2083)rn at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.<em>java</em>:1796)rn at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.<em>java</em>:874)rn at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.<em>java</em>:376)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:627)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:729)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:269)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:188)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.<em>java</em>:679)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.<em>java</em>:461)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.<em>java</em>:399)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.<em>java</em>:301)rn at org.apache.jsp.mainViews.downloadAction_jsp._jspService(downloadAction_jsp.<em>java</em>:74)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.<em>java</em>:98)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:729)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.<em>java</em>:331)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.<em>java</em>:329)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.<em>java</em>:265)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:729)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:269)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:188)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.<em>java</em>:679)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.<em>java</em>:461)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.<em>java</em>:399)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.<em>java</em>:301)rn at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.<em>java</em>:1063)rn at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.<em>java</em>:386)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.<em>java</em>:229)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.<em>java</em>:1194)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.<em>java</em>:414)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:627)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:729)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:269)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:188)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.<em>java</em>:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.<em>java</em>:172)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.<em>java</em>:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.<em>java</em>:117)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.<em>java</em>:108)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.<em>java</em>:174)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.<em>java</em>:875)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.<em>java</em>:665)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.<em>java</em>:528)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.<em>java</em>:81)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.<em>java</em>:689)rn at <em>java</em>.lang.Thread.run(Unknown Source)rn[/code]rnrn[size=18px]请问有谁知道原因的吗?[/size]
cliementine 服务器异常: java.net.SocketException: Connection reset
cliementine对模型进行分析,最后分析进行执行的时候,出现类似于内存出现<em>异常</em>,xxxxxx号<em>异常</em>,内存不能引用。rn具体的cliementine提示错误是::rn 服务器<em>异常</em>: <em>java</em>.net.SocketException: Connection <em>reset</em>,别人的机器上都没有问题,这是怎么回事,
【救助】关于selenium webdriver运行失败 java.net.SocketException: Connection reset
求助有用过selenium的童鞋们,我在eclipse下运行以下JAVA程序,调用chrome,访问www.baidu.com,这个脚本的时候 代码: import <em>java</em>.io.IOExcepti
HttpClient4引起的java.net.SocketException: Connection reset解决方法
HttpClient4引起的<em>java</em>.net.SocketException: Connection <em>reset</em>解决方法
java网络编程的java.net.SocketException: Connection reset异常
一开始学Stream时没注意过write的flush()方法,今天在学网络编程时,注意到了 服务器端: import <em>java</em>.net.*; import <em>java</em>.io.*; public class Client { public static void main(String[] args) throws Exception { Socket <em>socket</em> = new Soc
socketconnection reset异常
大家好,项目中通过<em>socket</em>调用远程接口,在JUint测试的时候,可以调用成功,但是启动tomcat调用接口,就报<em>java</em>.net.SocketException: Connection <em>reset</em><em>异常</em>,JUint和在action中调用的都是同个类下的同个方法,参数也是一样的,不知道是什么原因,请大家指导一下。另JUint和网站是在同个工程里面的
java socket 通信 connection reset问题
客户端(<em>java</em>)读取服务器端(C++)的数据,只能读取服务器端一次写入到流中的数据,在read就抛<em>java</em>.net.SocketException: Connection <em>reset</em>的错误,已经折磨我很长时间了,本人对C++不太了解,而且C++开发的客户端是正常的,所以我觉得我的代码肯定有问题,希望高人指点rn客户端代码:rn Socket <em>socket</em> = null;rn PrintWriter out = null;rn BufferedReader in = null;rn String result = "";rn try rn <em>socket</em> = new Socket(SocketConfig.SERVER_IP, SocketConfig.SERVER_PORT);rn <em>socket</em>.setSoTimeout(10000);rn in = new BufferedReader(new InputStreamReader(<em>socket</em>.getInputStream(), SocketConfig.CHAR_ENCODING));rnrn out = new PrintWriter(new OutputStreamWriter(<em>socket</em>.getOutputStream(), SocketConfig.CHAR_ENCODING), true);rnrn rn String cmd = SocketClient.genCmd(command);rn System.out.println("command:::" + cmd);rn out.println(cmd);rn out.flush();rnrn char[] head_char = new char[18];rn in.read(head_char);rn String head = new String(head_char);rn rn //输出到控制台rn System.out.print("resHead:::");rn System.out.println(head);rn rn char state = head.charAt(0);// 结果状态rn char encryptType = head.charAt(1);//加密方式rn int rows = Integer.parseInt(head.substring(2, 6));// 结果行数rn int cols = Integer.parseInt(head.substring(6, 10));// 每行字段数rn long byteCounts = Long.parseLong(head.substring(10, 18));// 结果字节数rn String resultBuf = "";// 结果内容rn rn //逐行读取结果内容rn for(int i = 0; i < rows; i++)rn String oneRow = in.readLine();rn System.out.println(oneRow);rn rnrn catch (Exception e) rn e.printStackTrace();rn throw new Exception(e);rnrn finally rn try rn if (null != out)rn out.close();rn if (null != in)rn in.close();rn if (null != <em>socket</em>)rn <em>socket</em>.close();rn catch (Exception e) rn e.printStackTrace();rn rn rnrn错误信息:rn<em>java</em>.net.SocketException: Connection <em>reset</em>rn at <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>:168)rn at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.<em>java</em>:411)rn at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.<em>java</em>:453)rn at sun.nio.cs.StreamDecoder.read(StreamDecoder.<em>java</em>:183)rn at <em>java</em>.io.InputStreamReader.read(InputStreamReader.<em>java</em>:167)rn at <em>java</em>.io.BufferedReader.fill(BufferedReader.<em>java</em>:136)rn at <em>java</em>.io.BufferedReader.read(BufferedReader.<em>java</em>:157)rn at com.rails.smm.cmd.SocketClient.execCmd(SocketClient.<em>java</em>:87)rn at com.rails.smm.cmd.SocketClient.main(SocketClient.<em>java</em>:163)rn
java.net.SocketException: Connection reset by peer: socket
最近一个项目中用到了Spring MVC 计时器 + HttpClient 发送http请求,封装post请求代码如下:
mongo报socket exception raised
问题背景       一个web应用的定时任务,每天把mysql的数据全量数据刷新到mongo中(第一步把mongo数据全清除,第二步再分批把mysql数据保存到mongo),一直运行良好。直到有天往这个系统迁移了大概60几w的数据后,发现定时任务把mongo数据删除,但没把mysql数据刷新进去。查看日志,报了如下<em>异常</em>: Closed <em>connection</em> [<em>connection</em>Id{lo...
SocketException四大异常解决方案
ava.net.SocketException如何才能更好的使用呢?这个就需要我们先要了解有关这个语言的相关问题。希望大家有所帮助。那么我们就来看看有关<em>java</em>.net.SocketException的相关知识。 第1个<em>异常</em>是 <em>java</em>.net.BindException:Address already in use: JVM_Bind。 该<em>异常</em>发生在服务器端进行new ServerS
求救:socket异步,通信到一半时,发生异常:System.Net.Sockets.SocketException (0x80004005):
服务端是异步Socket 和硬件设备进行照片的传输,总共的帧数是50帧左右,每帧是固定的249个字节,最后一帧不固定 服务端在收到硬件设备发送的报文时,会回发一个报文 当一切正常时,照片传输成功 当不
The socket connection was aborted的错误
我现在有客户端有一个wcf的服务器端 采用的是nettcpbinding模式, 我在客户端异步调用,写了for循环,for循环内部有sleep 如果我从客户端向服务器端调用的时候 如果sleep时间短
求助 Caused by: java.net.SocketException: Connection reset
严重: Exception starting filter struts2rnClass: <em>java</em>.net.SocketInputStreamrnFile: SocketInputStream.<em>java</em>rnMethod: readrnLine: 168 - <em>java</em>/net/SocketInputStream.<em>java</em>:168:-1rnat com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.<em>java</em>:835)rnat com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.<em>java</em>:131)rnat com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.<em>java</em>:100)rnat com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.<em>java</em>:130)rnat com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.<em>java</em>:52)rnat org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.<em>java</em>:395)rnat org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.<em>java</em>:452)rnat org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.<em>java</em>:201)rnat org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.<em>java</em>:275)rnat org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.<em>java</em>:397)rnat org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.<em>java</em>:108)rnat org.apache.catalina.core.StandardContext.filterStart(StandardContext.<em>java</em>:3693)rnat org.apache.catalina.core.StandardContext.start(StandardContext.<em>java</em>:4342)rnat org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.<em>java</em>:761)rnat org.apache.catalina.core.ContainerBase.addChild(ContainerBase.<em>java</em>:741)rnat org.apache.catalina.core.StandardHost.addChild(StandardHost.<em>java</em>:525)rnat org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.<em>java</em>:920)rnat org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.<em>java</em>:883)rnat org.apache.catalina.startup.HostConfig.deployApps(HostConfig.<em>java</em>:492)rnat org.apache.catalina.startup.HostConfig.start(HostConfig.<em>java</em>:1138)rnat org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.<em>java</em>:311)rnat org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.<em>java</em>:120)rnat org.apache.catalina.core.ContainerBase.start(ContainerBase.<em>java</em>:1023)rnat org.apache.catalina.core.StandardHost.start(StandardHost.<em>java</em>:719)rnat org.apache.catalina.core.ContainerBase.start(ContainerBase.<em>java</em>:1015)rnat org.apache.catalina.core.StandardEngine.start(StandardEngine.<em>java</em>:443)rnat org.apache.catalina.core.StandardService.start(StandardService.<em>java</em>:448)rnat org.apache.catalina.core.StandardServer.start(StandardServer.<em>java</em>:710)rnat org.apache.catalina.startup.Catalina.start(Catalina.<em>java</em>:552)rnat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.<em>java</em>:39)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.<em>java</em>:25)rnat <em>java</em>.lang.reflect.Method.invoke(Method.<em>java</em>:597)rnat org.apache.catalina.startup.Bootstrap.start(Bootstrap.<em>java</em>:288)rnat org.apache.catalina.startup.Bootstrap.main(Bootstrap.<em>java</em>:413)rnCaused by: Connection <em>reset</em> - Class: <em>java</em>.net.SocketInputStreamrnFile: SocketInputStream.<em>java</em>rnMethod: readrnLine: 168 - <em>java</em>/net/SocketInputStream.<em>java</em>:168:-1rnat com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.<em>java</em>:123)rnat com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.<em>java</em>:830)rn... 34 morernCaused by: <em>java</em>.net.SocketException: Connection <em>reset</em>rnat <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>:168)rnat <em>java</em>.io.BufferedInputStream.fill(BufferedInputStream.<em>java</em>:218)rnat <em>java</em>.io.BufferedInputStream.read1(BufferedInputStream.<em>java</em>:258)rnat <em>java</em>.io.BufferedInputStream.read(BufferedInputStream.<em>java</em>:317)rnat sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.<em>java</em>:647)rnat sun.net.www.http.HttpClient.parseHTTP(HttpClient.<em>java</em>:592)rnat sun.net.www.http.HttpClient.parseHTTP(HttpClient.<em>java</em>:612)rnat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.<em>java</em>:1004)rnat com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.<em>java</em>:677)rnat com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.<em>java</em>:1316)rnat com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.<em>java</em>:1283)rnat com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.<em>java</em>:283)rnat com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.<em>java</em>:1168)rnat com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.<em>java</em>:1068)rnat com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.<em>java</em>:988)rnat com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.<em>java</em>:645)rnat com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.<em>java</em>:140)rnat com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.<em>java</em>:508)rnat com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.<em>java</em>:807)rnat com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.<em>java</em>:737)rnat com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.<em>java</em>:107)rnat com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.<em>java</em>:1205)rnat com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.<em>java</em>:522)rnat <em>java</em>x.xml.parsers.SAXParser.parse(SAXParser.<em>java</em>:395)rnat com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.<em>java</em>:121)rn... 35 morern2010-4-22 10:27:58 org.apache.catalina.core.StandardContext startrn严重: Error filterStartrn2010-4-22 10:27:58 org.apache.catalina.core.StandardContext startrn严重: Context [/base3] startup failed due to previous errorsrnrn怎么解决啊??
java.net.SocketException: Connection reset是什么意思
如题,程序需要长时间运行,可是运行一段时间后,就显示这个错误
请教大侠:java.net.SocketException: Connection reset
请问,有几种错误有可能出现如下<em>异常</em>?rnrn rn
分析一下java.net.SocketException: Connection reset by peer: Connection reset by peer
使用jakarta-common-net编写了一个ftp客户端上传程序。rnrn运行一段时间后,会抛出上述<em>异常</em>。rn查看API文档后发现是由与setSoTimeout方法引起,该方法实际使用的是<em>java</em>.net.Socket的setSoTimeout,但是我还是不能确定产生<em>异常</em>的确切原因,rnSocketException - if there is an error in the underlying protocol, such as a TCP error.rn请大家帮忙分析一下。谢谢!
connection reset异常
各位,小弟目前正开发一个项目,涉及到<em>java</em>后台和前置机(C开发的)间的通讯。rn当数据量不大时(6000B左右)时正常,但当数据超过13000B时,每次<em>java</em>后台接收前置机返回的数据时都抛出<em>connection</em> <em>reset</em><em>异常</em>(debug时发现为 in.readLine()时<em>异常</em>)。不知真正原因在哪里(下面为<em>java</em>后台相关代码),急盼高人的解答。急,在线等……rn ……rn //建立网络连接rn Socket client;rn tryrn rn client = new Socket(ip, Integer.parseInt(port));rnrn int soTimeOut = Integer.parseInt(timeOut);rnrn if (soTimeOut > 0)rn rn //设置超时毫秒数rn client.setSoTimeout(soTimeOut);rn rnrn BufferedReader in = new BufferedReader(new InputStreamReader(clientrn .getInputStream()));rnrn PrintWriter out = new PrintWriter(client.getOutputStream());rn //增加报头信息 客户现场rn String branch = DataTools.getBranchByIP(ip);rn rn String size = String.valueOf(xmlString.getBytes().length);rn String titleXml = com.neusoft.finance.common.DataTools.leftMendStringLen(size,8,' ');rn String branchXml= com.neusoft.finance.common.DataTools.leftMendStringLen(branch,8,' ');rn rn xmlString = titleXml.concat(branchXml).concat(xmlString);rn log.info("发送的xml:"+xmlString);rn out.println(xmlString);rnrn out.flush();rnrn //前置机返回数据rn returnString = in.readLine(); rn log.info("返回的xml:"+returnString);rn client.close();rn rn catch (NumberFormatException e)rn rn ExcAct.doHandle(e);rn throw new SystemException(e);rn rn catch (UnknownHostException e)rn rn ExcAct.doHandle(e);rn throw new SystemException(e);rn rn catch (IOException e)rn rn ExcAct.doHandle(e);rn throw new SystemException(TradeConstCodeList.CONNECT_TIME_OUT,e,ip);rn rn catch (Exception e)rn ExcAct.doHandle(e);rn throw new SystemException(e);rn rn ……rn
异常 java.net.ConnectException:打开端口 50,000 上服务器 /10.45.2.2 的套接字时出错,消息为:Connection
2010.02.11 09:55:27 WARNING: failed to obtain next ID block due to thread contention. Trying again..
idhttp post 出现exception class EIdSocketError with message 'Socket Error # 10054的解决办法
由于项目需要。需要向一个地址提交数据。提交的次数很频繁,但是程序经常raised exception class EIdSocketError with message 'Socket Error # 10054 Connection <em>reset</em> by peer.' 造成程序<em>异常</em>,停止工作。     于是找到以下解决办法。Exception捕获不到该<em>异常</em>。需要用EIdException来捕获异
java.net.SocketException: Connection reset 解決方式
-
java.lang.RuntimeException: java.net.ConnectException: Connection timed out: con
报这个错误 <em>java</em>.lang.RuntimeException: <em>java</em>.net.ConnectException: Connection timed out: connect at org.ja
Socket问题 Connection reset?
顶起。我也有差不多的问题的。不过我的从服务器接收客户端的消息接受一切正常,当我关闭客户端是。程序就报<em>异常</em>。说Connection <em>reset</em> ?为什么啊?希望高手给我看看。下面我代码:rnpublic class ServerConClientThread extends Thread rn Socket s;rnrn public ServerConClientThread(Socket s) rn this.s = s;rnrn rnrn public void run() rn rn // TODO Auto-generated method stubrn while (true) rn rn try rn ObjectInputStream ois = new ObjectInputStream(s.getInputStream());rn Message m = (Message) ois.readObject();rn // 打印服务器受到的一方客户端的消息rn System.out.println(m.getSender() + "给" + m.getGetter() + "说"+ m.getContent());rn catch (Exception e) rn // TODO Auto-generated catch blockrn rn e.printStackTrace();rn rnrn rnrn rnrnrn报<em>异常</em>:rn<em>java</em>.net.SocketException: Connection <em>reset</em>rn at <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>:113)rn at <em>java</em>.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.<em>java</em>:2266)rn at <em>java</em>.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.<em>java</em>:2279)rn at <em>java</em>.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.<em>java</em>:2750)rn at <em>java</em>.io.ObjectInputStream.readStreamHeader(ObjectInputStream.<em>java</em>:780)rn at <em>java</em>.io.ObjectInputStream.(ObjectInputStream.<em>java</em>:280)rn at com.qq.server.model.ServerConClientThread.run(ServerConClientThread.<em>java</em>:26)rnrnrn26行就是 ObjectInputStream ois = new ObjectInputStream(s.getInputStream());rn
java.net.SocketException:Connection reset by peer: socket write error,500分
服务端和客户端在同一台计算机上 rn服务端用Java开发的,客户端用VC开发的,一般情况下运行正常,可是期间时不时的来一个客户端recv出错,几率很小,客户端错误代码10053 Software caused <em>connection</em> abort(软件原因导致连接中断)。而对应的Java服务端也会出错,错误代码Connection <em>reset</em> by peer(连接被对方复位)。 rnrn各位大侠,出这种错误的原因到底在哪?好像特别不好确定错误原因? rnrnrn解决了我另开贴给足500分!!
杯具啊,为什么会有java.net.SocketException: Connection reset这个异常
run-main:rn<em>java</em>.net.SocketException: Connection <em>reset</em>rn at <em>java</em>.net.SocketInputStream.read(SocketInputStream.<em>java</em>:168)rn at <em>java</em>.io.BufferedInputStream.fill(BufferedInputStream.<em>java</em>:218)rn at <em>java</em>.io.BufferedInputStream.read1(BufferedInputStream.<em>java</em>:258)rn at <em>java</em>.io.BufferedInputStream.read(BufferedInputStream.<em>java</em>:317)rn at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.<em>java</em>:687)rn at sun.net.www.http.HttpClient.parseHTTP(HttpClient.<em>java</em>:632)rn at sun.net.www.http.HttpClient.parseHTTP(HttpClient.<em>java</em>:652)rn at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.<em>java</em>:1064)rn at com.sun.syndication.io.XmlReader.(XmlReader.<em>java</em>:237)rn at com.rss.parseRss(rss.<em>java</em>:29)rn at com.rss.main(rss.<em>java</em>:75)rnrnrn有说是阻塞引起的可是,怎么解决呢? 求。。。高手解答!!!!
servlet文件下载,出现ClientAbortException: java.net.SocketException: Connection reset
小弟最近做了个servlet文件下载, 在浏览器中会弹出下载框, 但是点击取消下载按钮的时候, 控制台出现了错误,rnClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> rn,时间一长,tomcat就卡死了。rnrnrn我的servlet:rnrnpublic void doPost(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rnrn response.setHeader("Cache-Control","no-cache");rn response.setContentType("application/x-msdownload");rn response.setCharacterEncoding("UTF-8");rn String tempid = request.getParameter("id").toString();rn if(tempid!=null || !tempid.equals(""))rn String basePath = getServletContext().getRealPath("/");rn String url = basePath+getUrlById(tempid); //文件路径rn //创建输出流rn OutputStream out = null;rn FileInputStream fis = null;rn try rn out = response.getOutputStream();rn //打开输入流rn File file = new File(url);rn fis = new FileInputStream(file);rn String fname = file.getName(); //获取文件名rn response.setContentLength((int)file.length()); //设置文件流大小, 弹出下载框显示进度rn response.addHeader("Content-disposition","attachment;filename=" + new String(fname.getBytes("gbk"),"iso-8859-1"));rn rn rn byte[] b = new byte[1024];rn int i =0;rn while((i=fis.read(b,0,b.length))!=-1)rn out.write(b,0,i);rn rn out.flush();rn catch (IOException e) rn e.printStackTrace();rn finallyrn fis.close();rn out.close();rn rn rn rn rnrnrnrnrnrn控制台:rnrnrnClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.<em>java</em>:358)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.<em>java</em>:434)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.<em>java</em>:349)rn at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.<em>java</em>:381)rn at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.<em>java</em>:370)rn at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.<em>java</em>:89)rn at one.DownloadMobile.doPost(DownloadMobile.<em>java</em>:45)rn at one.DownloadMobile.doGet(DownloadMobile.<em>java</em>:16)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:617)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.<em>java</em>:188)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.<em>java</em>:96)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.<em>java</em>:75)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.<em>java</em>:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.<em>java</em>:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.<em>java</em>:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.<em>java</em>:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.<em>java</em>:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.<em>java</em>:293)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.<em>java</em>:849)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.<em>java</em>:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.<em>java</em>:454)rn at <em>java</em>.lang.Thread.run(Unknown Source)rnCaused by: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write0(Native Method)rn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write(Unknown Source)rn at <em>java</em>.net.SocketOutputStream.write(Unknown Source)rn at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.<em>java</em>:740)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.<em>java</em>:434)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.<em>java</em>:349)rn at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.<em>java</em>:764)rn at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.<em>java</em>:118)rn at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.<em>java</em>:573)rn at org.apache.coyote.Response.doWrite(Response.<em>java</em>:560)rn at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.<em>java</em>:353)rn ... 28 morernrnrnrn希望各位大侠看了之后给小弟指点一下
关于tomcat“java.net.SocketException: Connection reset by peer: socket write error”的错误
我这是tomcat+oraclern后台取数据放入页面时,随着点击次数越高,页面显示越来越慢,到最后干脆就是一白页了,后台就报一下面这个错误在:rnClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn at org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.jarnva:373)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.<em>java</em>:323)rn at org.apache.coyote.tomcat5.OutputBuffer.writeBytes(OutputBuffer.<em>java</em>:4rn01)rn at org.apache.coyote.tomcat5.OutputBuffer.write(OutputBuffer.<em>java</em>:388)rn at org.apache.coyote.tomcat5.CoyoteOutputStream.write(CoyoteOutputStreamrn.<em>java</em>:76)rn at org.apache.coyote.tomcat5.CoyoteOutputStream.write(CoyoteOutputStreamrn.<em>java</em>:70)rn at com.iss.inut.workflow.webmanage.web.WfDefineCtrl.preview(WfDefineCtrlrn.<em>java</em>:111)rn at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesrnsorImpl.<em>java</em>:25)rn at <em>java</em>.lang.reflect.Method.invoke(Method.<em>java</em>:324)rn at com.iss.system.base.BaseAction.execute(BaseAction.<em>java</em>:334)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequesrntProcessor.<em>java</em>:421)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.jarnva:226)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.<em>java</em>:116rn4)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.<em>java</em>:397)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:689)rn at <em>java</em>x.servlet.http.HttpServlet.service(HttpServlet.<em>java</em>:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplrnicationFilterChain.<em>java</em>:237)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.<em>java</em>:157)rn at com.iss.common.CharacterEncodingFilter.doFilter(CharacterEncodingFiltrner.<em>java</em>:102)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplrnicationFilterChain.<em>java</em>:186)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.<em>java</em>:157)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVrnalve.<em>java</em>:214)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValvrneContext.<em>java</em>:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.javrna:520)rn at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardrnContextValve.<em>java</em>:198)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVrnalve.<em>java</em>:152)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValvrneContext.<em>java</em>:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.javrna:520)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jrnava:137)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValvrneContext.<em>java</em>:104)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jrnava:118)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValvrneContext.<em>java</em>:102)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.javrna:520)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValrnve.<em>java</em>:109)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValvrneContext.<em>java</em>:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.javrna:520)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.<em>java</em>:929)rnrn at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.<em>java</em>:16rn0)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.<em>java</em>rn:799)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.procernssConnection(Http11Protocol.<em>java</em>:705)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.<em>java</em>rn:577)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPrnool.<em>java</em>:683)rn at <em>java</em>.lang.Thread.run(Thread.<em>java</em>:534)rn我应该怎么解决啊?我在网上查了很多,但都没给出一个确切的解决方法啊。
ClientAbortException: java.net.SocketException: Connection reset by peer: socke
在做文件下载的时候,出现了这个错误,找了很久没有找到,希望高手指点,但是文件可以顺利的下载下来,小文件下载不会出错,如果是100多M的文件下载就会出错。不知道为什么连接下载的那个jsp会执行很多次,也
JAVA NET Exception
第1个<em>异常</em>是<em>java</em>.net.BindException:Address already in use: JVM_Bind。该<em>异常</em>发生在服务器端进行new ServerSocket(port)(port是一个0,65536的整型值)操作时。<em>异常</em>的原因是以为与port一样的一个端口已经被启动,并进行监听。此时用netstat –an命令,可以看到一个Listending状态的端口。只需要找一个没有被
http client遭遇Connection reset问题,以及解决方法
客户端使用200个线程往服务器端发送数据,每次数据量约100K. 发送的时候使用了多线程连接池管理器 private MultiThreadedHttpConnectionManager <em>connection</em>Manager = new MultiThreadedHttpConnectionManager(); private HttpClient httpClient =
异常:ClientAbortException: java.net.SocketException: Connection reset by peer: socket
首先,我的问题不是一直不能导出Excel,只是在导出4次以上就开始报错,有时候第一次就开始报错不能导出,但是刷新页面后又可以导出了,以为是output流的没有正确关闭的问题,为了这个问题在网上逛了,很久,多数将原因总结如下: 常出现的Connection <em>reset</em> by peer: 原因可能是多方面的,不过更常见的原因是: ①:服务器的并发连接数超过了其承载量,服务器会将其中一些连接Dow
weblogic中 java.net.SocketException: Connection reset
weblogic中 <em>java</em>.net.SocketException: Connection <em>reset</em> 关于:<em>java</em>.net.SocketException: Connection <em>reset</em> 关键信息:一个请求中包含了两个POST数据包 以前经常听说关于这个错误,没有太多在意,认为我写的框架应该没有问题,第一感觉是网络不稳定产生的。 今天在一次偶尔的测试中,发现这个问题频繁的
ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error
这个<em>异常</em> ClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn是什么意思啊?谁能帮我解决阿? 这个问题快折磨死我了!rn我做了个权限管理rn前台为rn姓名 权限1 权限2 rn张三 1 1 (1代表无权限,0有无权限)rn李四 0 0rnrn问题是我如果在页面设置权限1或权限2为相反(1变0,0变1),数据库里改变了!但是当我以另一个用户名登陆这时数据库里为rn姓名 权限1 权限2rn张三 0 0 rn李四 1 1rnrn但是jsp页面仍然是rn姓名 权限1 权限2 rn张三 1 1 (1代表无权限,0有无权限)rn李四 0 0rnrn经过好多次刷新就偶尔会和数据库一致rnrn姓名 权限1 权限2rn张三 0 0 rn李四 1 1rnrn权限我在页面用checkbox实现 如果为0就打勾,如果为1就不打勾rn具体代码rn rn rn IDrn USERNAMErn EDITrn ROLE-INrn ROLE-SYSrn DELETErn rn rn < staffs.size(); i++)rn rn StaffEx staff1 = (StaffEx)staffs.get(i);rn %>rn rn rn rn Editrn rn rn rn rn rn rn rn rn rn rn rn rn Deletern rn rn
请教,验证码:ClientAbortException:java.net.SocketException:Connection reset bypeer:异常
【退出系统,转入登录页面时报以下<em>异常</em> ,ValidateCodeAction 是验证码生成Action类】rnClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.<em>java</em>:319)rn at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.<em>java</em>:288)rn at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.<em>java</em>:98)rn at <em>java</em>x.imageio.stream.FileCacheImageOutputStream.close(FileCacheImageOutputStream.<em>java</em>:219)rn at <em>java</em>x.imageio.ImageIO.write(ImageIO.<em>java</em>:1567)rn at com.sf.studentmanager.sys.web.ValidateCodeAction.initValidateCode(ValidateCodeAction.<em>java</em>:84)rn .....rn at <em>java</em>.lang.Thread.run(Thread.<em>java</em>:619)rnCaused by: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write0(Native Method)rn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write(SocketOutputStream.<em>java</em>:92)rn at <em>java</em>.net.SocketOutputStream.write(SocketOutputStream.<em>java</em>:136)rn at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.<em>java</em>:741)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.<em>java</em>:432)rn at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.<em>java</em>:299)rn at org.apache.coyote.http11.Http11Processor.action(Http11Processor.<em>java</em>:981)rn at org.apache.coyote.Response.action(Response.<em>java</em>:183)rn at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.<em>java</em>:314)rn ... 79 morern rnValidateCodeAction 代码【验证码生成类】==============================================rn rnpublic class ValidateCodeAction extends ActionSupport implementsrn ServletResponseAware, ServletRequestAware rn private HttpServletResponse response;rn private HttpServletRequest request;rnrn public void setServletResponse(HttpServletResponse response) rn // TODO Auto-generated method stubrn this.response = response;rn rnrn public void setServletRequest(HttpServletRequest request) rn // TODO Auto-generated method stubrn this.request = request;rn rnrn Color getRandColor(int fc, int bc) rn Random random = new Random();rn if (fc > 255)rn fc = 255;rn if (bc > 255)rn bc = 255;rn int r = fc + random.nextInt(bc - fc);rn int g = fc + random.nextInt(bc - fc);rn int b = fc + random.nextInt(bc - fc);rn return new Color(r, g, b);rn rnrn public String initValidateCode() rnrn response.setHeader("Pragma", "No-cache");rn response.setHeader("Cache-Control", "no-cache");rn response.setDateHeader("Expires", 0);rnrn int width = 60, height = 20;rn BufferedImage image = new BufferedImage(width, height,rn BufferedImage.TYPE_INT_RGB);rnrn Graphics g = image.getGraphics();rnrn Random random = new Random();rnrn g.setColor(getRandColor(200, 250));rn g.fillRect(0, 0, width, height);rnrn g.setFont(new Font("Times New Roman", Font.PLAIN, 18));rnrn g.setColor(getRandColor(160, 200));rn for (int i = 0; i < 155; i++) rn int x = random.nextInt(width);rn int y = random.nextInt(height);rn int xl = random.nextInt(12);rn int yl = random.nextInt(12);rn g.drawLine(x, y, x + xl, y + yl);rn rn String sRand = "";rn for (int i = 0; i < 4; i++) rn String rand = String.valueOf(random.nextInt(10));rn sRand += rand;rn g.setColor(new Color(20 + random.nextInt(110), 20 + randomrn .nextInt(110), 20 + random.nextInt(110)));rn g.drawString(rand, 13 * i + 6, 16);rn rn this.request.getSession().setAttribute("validateCode", sRand);rn g.dispose();rn try rn ImageIO.write(image, "JPEG", response.getOutputStream());rn response.getOutputStream().flush();rn response.getOutputStream().close();rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn return null;rnrn rnrnrn rn jsp页面:===================================================rn rn
关于java.net.SocketException: Connection reset by peer: socket write error的问题请教!
大家好,本人在开发首页的地图导航显示数据时,遇到一些关于 rnException Processing ErrorPage[errorCode=404, location=/building.jsp]rnClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write error的问题。rn本功能大概是:在鼠标移动到某个城市时,将显示一个从数据库读取的城市生产总额和项目数等信息。rn本人用了AJAX进行异步交互读取数据来显示。虽然能成功显示,但是在ECLIPSE的窗口总是会出现错误如上所示,经上网查后发现是可能<em>自己</em>在客户端做测试时用鼠标移动到下个城市太快的缘故吧,导致客户端不停刷新,造成无用的进程,虽然数据能正常显示,但我想请教各位高手有什么好的解决方案使后台不会有Connection <em>reset</em> by peer: <em>socket</em> write error提示出现,谢谢!rnrn以下是我写的一些代码:rnindex.jsp:rn//执行请求发送rnfunction send_request(url,strsearchoose) rn if (url != "") rn // 获取一个XMLHttpRequest实例rn var req = newXMLHttpRequest();rn //alert(req);rn // 设置用来 从请求对象 接收回调通知 的句柄函数 rn var handlerFunction = processRequest(req,strsearchoose);rn req.onreadystatechange = handlerFunction;rn // 打开一个联接到XXXservlet的HTTP POST联接rn // 第三个参数表示请求是异步的rn req.open("GET", url, true);rn // 指示请求体包含form数据rnreq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");rn req.send(null);rn else rn alert("");rn rn rn/*初始化对象并发出XMLHttpRequest请求*/rnfunction newXMLHttpRequest() rn var xmlreq = false;rn if (window.XMLHttpRequest) rn // 在非Microsoft浏览器中创建XMLHttpRequest对象rn xmlreq = new XMLHttpRequest();rn else rn if (window.ActiveXObject) rn //通过MS ActiveX创建XMLHttpRequestrn try rn // 尝试按新版InternetExplorer方法创建rn xmlreq = new ActiveXObject("Msxml2.XMLHTTP");rn rn catch (e1) rn // 创建请求的ActiveX对象失败rn try rn // 尝试按老版InternetExplorer方法创建rn xmlreq = new ActiveXObject("Microsoft.XMLHTTP");rn rn catch (e2) rn // 不能通过ActiveX创建XMLHttpRequestrn rn rn rn rn return xmlreq;rnrnfunction processRequest(req,strsearchoose) rn return function () rn // 如果请求的状态是“完成”rn if (req.readyState == 4) rn // 检查是否成功接收了服务器响应rn if (req.status == 200) rn // 将载有响应信息的XML传递到处理函数rn //responseXmlHandler(req.responseXML);rn //将传回的信息当字符串使用rnif(strsearchoose=="0")rn document.getElementById("report").innerHTML = req.responseText;rn //alert(req);rn elsern document.getElementById("projectlist").innerHTML = req.responseText;rn rn else rn // 有HTTP问题发生rn alert("" + req.status);rn return false;rn rn rn ;rnrnrnfunction showreport(id,name)//使用此方法来调用AJAX框架进行发送请求rn var strid=id;rn var strname=name;rn var stryear=document.getElementById("year").value;rn var strmonth=document.getElementById("month").value;rn var strsearchoose=0;rn //alert(strid+"--"+name+"--"+stryear+"--"+strmonth);rnvar url="ajaxsearch.jsp?searchoose="+strsearchoose+"&statareaid="+strid+"&statareaname="+escape(encodeURI(strname))+"&year="+stryear+"&month="+strmonth;rn //alert(url);rn send_request(url,strsearchoose);//调用上面的请求方法rn rnajaxsearch.jsp:rn
再谈:java.net.SocketException: Connection reset by peer: socket write error
rnrnrnrn rn信息录入rnrn rn rnrnrn rn 参数错误,请查证! rnpageCount)rn rn curPageIndex=pageCount;rn rn if(curPageIndexrn rn rn rn rn rn rn 50 && FType=="A")rn rn %>rn yes.............rn rn oh,no...........rn rn rn rn rn rnrn rn rn rn 共步 第步 rn 1) %>rn rn rn rn < pageCount) rn %>rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrn以下错误信息,在浏览这个页面的时候,偶尔会出现这个错误,有时它又不出错,为什么???rn信息如下:rnrn
下载功能出现java.net.SocketException: Connection reset by peer: socket write error
<em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write0(Native Method)rn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write(SocketOutputStream.<em>java</em>:92)rn at <em>java</em>.net.SocketOutputStream.write(SocketOutputStream.<em>java</em>:136)rn at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.<em>java</em>:760)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.<em>java</em>:432)rn at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.<em>java</em>:347)rn at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.<em>java</em>:784)rn at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.<em>java</em>:124)rn at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.<em>java</em>:593)rn at org.apache.coyote.Response.doWrite(Response.<em>java</em>:560)rn at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.<em>java</em>:353)rn at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.<em>java</em>:432)rn at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.<em>java</em>:309)rn at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.<em>java</em>:273)rn at org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.<em>java</em>:104)rn at com.opensymphony.webwork.dispatcher.StreamResult.doExecute(StreamResult.<em>java</em>:211)rn at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.<em>java</em>:143)rn at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.<em>java</em>:313)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:208)rn at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.<em>java</em>:175)rn at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.<em>java</em>:86)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.<em>java</em>:116)rn at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.<em>java</em>:86)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.<em>java</em>:31)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.<em>java</em>:31)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.<em>java</em>:31)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.<em>java</em>:174)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.<em>java</em>:31)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.webwork.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.<em>java</em>:169)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.<em>java</em>:31)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.<em>java</em>:151)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.<em>java</em>:31)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.<em>java</em>:31)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.<em>java</em>:31)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.<em>java</em>:186)rn at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.<em>java</em>:190)rn at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.<em>java</em>:116)rn at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.<em>java</em>:274)rn at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.<em>java</em>:202)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.<em>java</em>:198)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.<em>java</em>:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.<em>java</em>:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.<em>java</em>:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.<em>java</em>:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.<em>java</em>:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.<em>java</em>:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.<em>java</em>:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.<em>java</em>:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.<em>java</em>:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.<em>java</em>:859)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.<em>java</em>:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.<em>java</em>:489)rn at <em>java</em>.lang.Thread.run(Thread.<em>java</em>:595)rn使用的是webworkrnrn<em>java</em>代码:rn[code=Java]rnpublic String downloadArticleFile()rn Long articleId = Long.parseLong(getRequest().getParameter("id"));rn HttpServletRequest request=(HttpServletRequest)ActionContext.getContext().get(rn ServletActionContext.HTTP_REQUEST);rn String path=request.getSession().getServletContext().getRealPath("/fujian");rn File file = new File(path+"/"+articleId+".pdf");rn contentType="application/octet-stream;charset=UTF-8";rn try rn inputStream= new FileInputStream(file);rn catch (FileNotFoundException e) rn e.printStackTrace();rn rn fileName=articleId+".pdf";rn return "downloadFile";rn rn[/code]rnxwork.xml:rn[code=XML]rnrnrn rn rn rn rn rn rn inputStreamrn $contentTypern attachment;filename="$fileName"rn 2048rn rn rn rnrn[/code]
Jmeter高并发压测时 java.net.SocketException: Connection reset 报错解决方案
新建注册表脚本reg文件,编辑值如下,保存后双击执行;重启电脑,再次压测即不会出现报错相关值解析MaxUserPort:最大动态端口数(Default = 5000, Max = 65534) TcpTimedWaitDelay:TCP等待延迟时间(30) TcpNumConnections:TCP最大连接数(Default = 16,777,214)MaxFreeTcbs:最大TCP控制块(10...
java.net.SocketException: Connection reset 关于socket连接异常
第1个<em>异常</em>是<em>java</em>.net.BindException:Address already in use: JVM_Bind。该<em>异常</em>发生在服务器端进行new ServerSocket(port)(port是一个0,65536的整型值)操作时。<em>异常</em>的原因是以为与port一样的一个端口已经被启动,并进行监听。此时用netstat –an命令,可以看到一个Listending状态的端口。只需要找一个没有被
JAVA异常:ClientAbortException: java.net.SocketException: Connection reset by peer: socket
记:5月18号下午 刚帮客户解锁登陆ip后,客户求助导出excel无响应,于是博主赶忙尝试登陆系统边尝试导出边思考,是否最近一次更新系统不小心更错了,仔细一想,上次更新内容不多不至于影响导出这一块代码。 于是我打开日志,找到了ClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> by pee...
ClientAbortException: java.net.SocketException: Connection reset
ClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> at org.apache.coyote.tomcat4.Output
Redis java.net.SocketException: Connection reset
Redis 的保护模式开启了,解决办法 1.启动redis.redis-server 2.redis-cli 3.CONFIG SET protected-mode no
紧急求救:java.net.SocketException: Connection reset by peer: socket write error
网站以前正常运行很长时间了,最近也没有动过。但是今天突然访问速度很慢了,重启Tomcat后可以正常访问,但是一会儿之后就又非常慢了,而且catalina.2006-06-13.log文件能到上百兆!!!rn环境为:windows+tomcat5.5+iis,我将iis和tomcat集成起来了。rnrncatalina.2006-06-13.log文件中的错误为:rnrn2006-6-13 15:48:54 org.apache.jk.core.MsgContext actionrn警告: Error sending end packetrn<em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write0(Native Method)rn at <em>java</em>.net.SocketOutputStream.<em>socket</em>Write(Unknown Source)rn at <em>java</em>.net.SocketOutputStream.write(Unknown Source)rn at org.apache.jk.common.ChannelSocket.send(ChannelSocket.<em>java</em>:508)rn at org.apache.jk.common.JkInputStream.endMessage(JkInputStream.<em>java</em>:112)rn at org.apache.jk.core.MsgContext.action(MsgContext.<em>java</em>:293)rn at org.apache.coyote.Response.action(Response.<em>java</em>:182)rn at org.apache.coyote.Response.finish(Response.<em>java</em>:304)rn at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.<em>java</em>:204)rn at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.<em>java</em>:282)rn at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.<em>java</em>:744)rn at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.<em>java</em>:674)rn at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.<em>java</em>:866)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.<em>java</em>:684)rn at <em>java</em>.lang.Thread.run(Unknown Source)rn2006-6-13 15:48:54 org.apache.jk.common.ChannelSocket processConnectionrn警告: processCallbacks status 2
java.net.SocketException: Connection reset --> when occurs, how to resolve
[phenomenon]rnrnThere is the error occurs sometimes when our web application system is transferred into so low-speed the net entironmentrnrn<em>java</em>.net.SocketException: Connection <em>reset</em>rnat <em>java</em>.net.SocketInputStream.read(Unknown Source)rnat <em>java</em>.io.BufferedInputStream.fill(Unknown Source)rnat <em>java</em>.io.BufferedInputStream.read1(Unknown Source)rnat <em>java</em>.io.BufferedInputStream.read(Unknown Source)rnat sun.net.www.http.ChunkedInputStream.fastRead(Unknown Source)rnat sun.net.www.http.ChunkedInputStream.read(Unknown Source)rn......rn......rnrnOur web application system is based Apache server. There is an client applet to get data from service before client-printing every time.rnBut when getting data sometimes, there is that error.rnrn[perplexed]rnrnIf you have a look at that exception stack information, you could see it is a problem relative JDK, not relative business application. Maybe is it a bug of JAVA?rnWho can teach me the following questions:rn1, Whether is it a bug of JAVA?rn2, When is this error occurred?rn3, How to avoid it, or if it is occurred, how to resolve this error?rnrnHope for your answer! Expecting!rnrn简单的用中文描述,就是在高速网络状况下没有问题,极低速网络状况下出现那个exception,什么原因?这是否是<em>java</em>的bug?那个exception通常在什么时候会出现?如果出现了,如何解决?rnrn请高手指教!rn
java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
[code=<em>java</em>]rnrnpublic static String doPost(String url,String execResult)rn String result = "";rn // 向服务器传送数据rn HttpPost httpPost = new HttpPost(url);rn // 先封装一个json对象rn JSONObject param = new JSONObject();rn List params = new ArrayList();rn SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式rn String time = df.format(new Date());rn params.add(new BasicNameValuePair("time",time));rn params.add(new BasicNameValuePair("phone",EnterActivity.edit_phone.getText().toString()));rn params.add(new BasicNameValuePair("model","自助排障"));rn params.add(new BasicNameValuePair("op_type", FlowPanelActivity.flow_name));rn params.add(new BasicNameValuePair("op_detail ", execResult));rn params.add(new BasicNameValuePair("op_result","成功"));rn // 绑定到entityrn try rn StringEntity entity = new StringEntity(params.toString());rn httpPost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));rn HttpResponse response = new DefaultHttpClient().execute(httpPost);rn if (response.getStatusLine().getStatusCode() == 200) rn result = EntityUtils.toString(response.getEntity());rn rn catch (Exception e) rn result = "提交失败";rn e.printStackTrace();rn rn return result;rn rn[/code]rnrn其他的都一切正常 就是response里面不执行 然后直接跳到了exception 显示<em>异常</em>rnrn<em>java</em>.net.SocketException: recvfrom failed: ECONNRESET (Connection <em>reset</em> by peer)。rnrn求助!
求助:java.net.SocketException: Connection reset 问题 急
Socket fromSt = new Socket(8989);rnfromDis = new DataInputStream(new BufferedInputStream(fromSt.getInputStream())); rnbyte[] buf = new byte[2048];rnint read = 0;rnwhile((read=fromDis.read(buf)) != -1) rnrn...rnrnrnfromDis是一个DataInputStream对象rnrn就是在循环读取fromDis时出现了<em>java</em>.net.SocketException: Connection <em>reset</em><em>异常</em>。rn循环前几次正常 然后莫名的就抛出这个<em>异常</em>了。rn请高手指教rn
Input/output error: java.net.SocketException: Connection reset
快速点击页面中多个超连接的时候,weblogic报:Input/output error: <em>java</em>.net.SocketException: Connection <em>reset</em>rn但是好像并不影响程序执行。rn在google搜到的说明:rn在页面上快速点击多个超链接,最好是在发送一个请求后前端页面还没有完全响应的时候点击另外一个超链接,多试几次就会出现这个<em>异常</em>。rn问题出现的原因是当SERVLET完成业务逻辑的处理后,向响应页面输出结果时,前端客户切换到了另外一个页面,所以就会出现<em>socket</em>s write error。这种错误对系统运行是没有什么影响的,只是在后台输出很多<em>异常</em>信息让人很郁闷。rnrnrn不知道有什么好的解决办法没有?rn
导致java.net.SocketException: Connection reset 的原因
第1个<em>异常</em>是<em>java</em>.net.BindException:Address already in use: JVM_Bind。该<em>异常</em>发生在服务器端进行new ServerSocket(port)(port是一个0,65536的整型值)操作时。<em>异常</em>的原因是以为与port一样的一个端口已经被启动,并进行监听。此时用netstat –an命令,可以看到一个Listending状态的端口。只需要找一个没有被
Connection reset by peer: socket write error错误分析及解决
Connection <em>reset</em> by peer: <em>socket</em> write error错误分析:常出现的Connection <em>reset</em> by peer: 原因可能是多方面的,不过更常见的原因是:  ①:服务器的并发连接数超过了其承载量,服务器会将其中一些连接Down掉;  ②
Socket java.net.SocketException: Connection reset错误异常的原因及解决
目录 一、错误代码 1.1 Socket客户端代码 1.2 Socket服务器代码 二、错误原因 三、解决方案 一、错误代码 1.1 Socket客户端代码 public class Client2 { public static void main(String[] args) { try { Socket <em>socket</em> =...
java.net.SocketException: Connection reset 帮忙看下什么原因
import <em>java</em>x.net.ssl.SSLSocketFactory;rnimport <em>java</em>x.net.ssl.SSLSocket;rnrnimport com.sun.net.ssl.SSLContext;rnimport com.sun.net.ssl.TrustManager;rnimport com.sun.net.ssl.X509TrustManager;rnrnimport <em>java</em>.net.URL;rnimport <em>java</em>.net.UnknownHostException;rnimport <em>java</em>.security.KeyManagementException;rnimport <em>java</em>.security.NoSuchAlgorithmException;rnimport <em>java</em>.security.cert.CertificateException;rnimport <em>java</em>.security.cert.X509Certificate;rnimport <em>java</em>.util.Properties;rnimport <em>java</em>.io.IOException;rnimport <em>java</em>.io.*;rnimport <em>java</em>.net.MalformedURLException;rnimport <em>java</em>x.net.ssl.HandshakeCompletedEvent;rnimport <em>java</em>x.net.ssl.HandshakeCompletedListener;rnimport <em>java</em>.net.SocketException;rnimport com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection;rnrnrnpublic class SSLTest rnrn public static void main(String args[])rn rnrn System.setProperty("<em>java</em>x.net.ssl.trustStore", "E://Java//jdk1.5.0_06//jre//lib//jdk-cacerts");rn System.setProperty("<em>java</em>x.net.ssl.trustStorePassword", "changeit");rn rnrnrnrn rn SSLSocketFactory factory =(SSLSocketFactory)SSLSocketFactory.getDefault();rn SSLSocket <em>socket</em>=null;rn rn tryrnrn rn <em>socket</em> =(SSLSocket)factory.createSocket("172.25.73.225", 443);rn System.out.println("Conntion succeed!");rnrn rn catch(UnknownHostException e1)rn rn System.out.println("Conntion fail 1!");rn e1.printStackTrace();rn catch(IOException e2)rn rn System.out.println("Conntion fail 2!");rn e2.printStackTrace();rn rn rn rn String getRequest = "GET " + "https://172.25.73.225/GS/Admin/Welcome.asp" + " HTTP/1.1";rn String hostSpecification = "Host: " + "172.25.73.225";rn System.out.println(getRequest);rn System.out.println(hostSpecification);rn rn rn tryrn rnrn PrintWriter out = new PrintWriter(rn new BufferedWriter(rn new OutputStreamWriter(rn <em>socket</em>.getOutputStream()))); rn out.println(getRequest);rn out.println(hostSpecification);rn out.println();rn out.flush();rnrn if (out.checkError())rn System.out.println("SSLSocketClient: <em>java</em>.io.PrintWriter error");rnrn // read response rn rn BufferedReader in = new BufferedReader(rn new InputStreamReader(<em>socket</em>.getInputStream()));rnrn String inputLine;rn while ((inputLine = in.readLine()) != null)rn rn System.out.println(inputLine);rn rn rnrn in.close();rn out.close();rn <em>socket</em>.close();rnrn rn catch(Exception e)rn rn System.out.println("Conntion fail 3!");rn e.printStackTrace();rn rn rnrn rn rnrn/////////////////////////////////////////////////////////////////////////////rn用IE可以打开改网页rn但是程序 读出的是rnConntion succeed!rnGET https://172.25.73.225/GS/Admin/Welcome.asp HTTP/1.1rnHost: 172.25.73.225rnHTTP/1.1 302 Object movedrnServer: Microsoft-IIS/5.0rnDate: Fri, 29 Sep 2006 06:29:21 GMTrnX-Powered-By: ASP.NETrnLocation: /GS/Admin/Login.asprnContent-Length: 121rnContent-Type: text/html; Charset=utf-8rnExpires: Fri, 29 Sep 2006 06:28:21 GMTrnSet-Cookie: ASPSESSIONIDQSBABQRS=DGEKHCIAPNNCNEMPJKFBECBO; path=/rnCache-control: privaternrn Object movedrn Object MovedThis object may be found here.rnConntion fail 3!rnrn并且有<em>异常</em>rn<em>java</em>.net.SocketException: Connection <em>reset</em>rnrn是什么原因rnrnrnrnrn
java.net.SocketException: Connection reset 分高,在线等!!!!
老是解决不了 跪求帮忙!rn代码如下rn服务器:rn[code=Java]package Server;rnrnimport <em>java</em>.io.*;rnimport <em>java</em>.awt.*;rnimport <em>java</em>x.<em>swing</em>.*;rnrnimport <em>java</em>.awt.event.*;rnimport <em>java</em>.net.*;rnpublic class MyServer extends JFrame implements ActionListener rnrn public static void main(String[] args) rn // TODO Auto-generated method stubrn MyServer ms=new MyServer();rn rn JPanel jp=null;rn JTextArea jta;rn JTextField jt=null;rn JScrollPane jsp=null;rn JButton jb=null;rn PrintWriter pw=null;rn rn public MyServer()rn rn jp=new JPanel();rn jt=new JTextField(15);rn jb=new JButton("发送"); rn jb.addActionListener(this);rn jta=new JTextArea();rn jsp=new JScrollPane(jta);rn rn jp.add(jt);rn jp.add(jb);rn rn this.add(jsp,"Center");rn this.add(jp,"South");rn this.setSize(300,200);rn this.setTitle("服务器");rn this.setVisible(true);rn rn try rn ServerSocket ss=new ServerSocket(8888);rn //System.out.println("这是服务器 端口是9988。。。。。");rn Socket s=ss.accept();rn rn InputStreamReader isr=new InputStreamReader(s.getInputStream());rn BufferedReader br=new BufferedReader(isr);rn pw=new PrintWriter(s.getOutputStream(),true);rn // s.close();rn while(true)rn rn String info=br.readLine();rn jta.append("客户端对你说: "+info+"\r\n");rn rn rn rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn rnrn @Overridern public void actionPerformed(ActionEvent e) rn // TODO Auto-generated method stubrn if(e.getSource()==jb)rn rn String info=jt.getText();rn jta.append("你对客户端说: "+info + "\r\n");rn pw.print(info);rn jt.setText("");rn rn rn rn rnrn[/code]rn---------------------------------------------------------------------------------------------------------------rn客户端rn[code=Java]package Client;rnrnimport <em>java</em>.io.*;rnimport <em>java</em>.awt.*;rnimport <em>java</em>x.<em>swing</em>.*;rnrnimport <em>java</em>.awt.event.*;rnimport <em>java</em>.net.*;rnpublic class MyClient extends JFrame implements ActionListenerrnrn public static void main(String[] args) rn // TODO Auto-generated method stubrn MyClient ms=new MyClient();rn rn JPanel jp=null;rn JTextArea jta;rn JTextField jt=null;rn JScrollPane jsp=null;rn JButton jb=null;rn PrintWriter pw;rn public MyClient()rn rn jp=new JPanel();rn jt=new JTextField(15);rn jb=new JButton("发送");rn jb.addActionListener(this);rn jta=new JTextArea();rn jsp=new JScrollPane(jta);rn rn jp.add(jt);rn jp.add(jb);rn rn this.add(jsp,"Center");rn this.add(jp,"South");rn this.setSize(300,200);rn this.setTitle("客户端");rn this.setVisible(true);rn rn try rn Socket s=new Socket("127.0.0.1",8888);rn InputStreamReader isr2=new InputStreamReader(s.getInputStream());rn BufferedReader br=new BufferedReader(isr2);rn pw=new PrintWriter(s.getOutputStream(),true);rn //s.close();rn while(true)rn rn String info=br.readLine();rn jta.setText("服务器对你说: "+info+"\r\n"); rn rn rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn @Overridern public void actionPerformed(ActionEvent e) rn // TODO Auto-generated method stubrn if(e.getSource()==jb)rn rn String info=jt.getText();rn jta.append("你对服务器说: "+info+"\r\n");rn pw.print(info);rn jt.setText("");rn rn rn rn rn[/code]
ClientAbortException: java.net.SocketException: Connection reset by peer: sock
各位大哥!rnrn我的WEB系统,用着用着,客户端浏览器就假死,即出现白屏,屏幕很久打不开.感觉好象就是没有得到数据库连接.rn但是服务器日志不报错.rnrn在这个出现之前有报rn ClientAbortException: <em>java</em>.net.SocketException: Connection <em>reset</em> by peer: <em>socket</em> write errorrnrn这个错误,不知道是否有联系.各位我该如何应对?郁闷啊rn
基于Proteus的单片机交通灯设计下载
单片机交通灯设计利用仿真软件Proteus实现结合KEIL编程实现交通灯的设计 相关下载链接:[url=//download.csdn.net/download/zcc0755/2934650?utm_source=bbsseo]//download.csdn.net/download/zcc0755/2934650?utm_source=bbsseo[/url]
网络IP地址解析,VC++源码下载
用于输入连串的网络地址,解析出常用的IP方式 相关下载链接:[url=//download.csdn.net/download/fresh24/4193245?utm_source=bbsseo]//download.csdn.net/download/fresh24/4193245?utm_source=bbsseo[/url]
linux驱动 程序下载
rtc的驱动,S3C2440,LINUX 非常实用 相关下载链接:[url=//download.csdn.net/download/chenhuochenhuo/4217660?utm_source=bbsseo]//download.csdn.net/download/chenhuochenhuo/4217660?utm_source=bbsseo[/url]
我们是很有底线的