java.net.SocketTimeoutException: Read timed out问题排查

版权声明: https://blog.csdn.net/Soul_Programmer_Swh/article/details/80913843
问题日志:
java.sql.SQLException: I/O Error: Read timed out
	at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1053) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:465) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1304) ~[jtds-1.2.5.jar:1.2.5]
	at net.sf.log4jdbc.sql.jdbcapi.StatementSpy.executeQuery(StatementSpy.java:731) ~[log4jdbc-log4j2-jdbc4-1.16.jar:na]
	at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:73) [c3p0-0.9.1.2.jar:0.9.1.2]
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:374) [c3p0-0.9.1.2.jar:0.9.1.2]
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310) [c3p0-0.9.1.2.jar:0.9.1.2]
	at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:1999) [c3p0-0.9.1.2.jar:0.9.1.2]
	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) [c3p0-0.9.1.2.jar:0.9.1.2]
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.6.0_43]
	at java.net.SocketInputStream.read(SocketInputStream.java:129) ~[na:1.6.0_43]
	at java.io.DataInputStream.readFully(DataInputStream.java:178) ~[na:1.6.0_43]
	at java.io.DataInputStream.readFully(DataInputStream.java:152) ~[na:1.6.0_43]
	at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:846) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:727) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:103) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.ResponseStream.peek(ResponseStream.java:88) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3932) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1046) ~[jtds-1.2.5.jar:1.2.5]
	... 8 common frames omitted
2018-07-04 01:07:43 [ERROR] [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] jdbc.sqltiming - 221. Connection.getAutoCommit()

一般来说是数据库连接问题,没有连上或是网络问题(网络波动)。

查看服务器jdbc日志,发现报read timed out异常不是连续的,是间断的,查一段时间库断了,在查一段时间库又断了。。。。。

求助!java.net.SocketTimeoutException: Read timed out

10-20

本地项目调用webservice服务时遭遇异常,控制台输出:rn信息: Interceptor has thrown exception, unwinding nowrnorg.apache.cxf.interceptor.Fault: Could not send Message.rn at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)rn at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:471)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:301)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:253)rnrn at java.lang.Thread.run(Thread.java:619)rnCaused by: java.net.SocketTimeoutException: Read timed outrn at java.net.SocketInputStream.socketRead0(Native Method)rn at java.net.SocketInputStream.read(SocketInputStream.java:129)rn at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)rn at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)rn at java.io.BufferedInputStream.read(BufferedInputStream.java:317)rnrnjavax.xml.ws.soap.SOAPFaultException: Could not send Message.rn at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:141)rn at $Proxy73.appb(Unknown Source)rn at com.xxxxx.impl.sdaf.sssdd(fds.java:570)rn at com.xxxxx.impl.appla.appb(appa.java:76)rn at com.xxxxx.impl.appa$$FastClassByCGLIB$$d209058b.invoke()rn at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)rn at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)rn at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)rnrnCaused by: java.net.SocketTimeoutException: Read timed outrn at java.net.SocketInputStream.socketRead0(Native Method)rn at java.net.SocketInputStream.read(SocketInputStream.java:129)rn at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)rn at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)rn rn ... 107 more。rn恳请大家帮忙分析解决下,谢谢!

请教 java.net.SocketTimeoutException: Read timed out

04-29

上传文件代码beanrn/**rn * @author lichuxiongrn */rnpackage arch.upload;rnrnimport java.io.*;rnimport java.util.Date;rnimport javax.servlet.http.*;rnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnimport javax.servlet.http.HttpSession;rnimport javax.servlet.ServletInputStream;rnrnrn public class UpFileThread implements Runnablern rn HttpServletRequest request;rn HttpServletResponse response;rn private boolean state;//线程是否已经启动rn private boolean running;//是否正在运行rn private boolean complete;//是否已经完成rn private int percent; rn rn public UpFileThread() rn super();rn state=false;rn running=false;rn complete=false;rn percent=0;rn rn rn /**rn * 初始化时把页面的request和response传递进来rn * @param requestrn * @param responsern */rn public UpFileThread(HttpServletRequest request,HttpServletResponse response) rn super();rn this.request=request;rn this.response=response;rn state=false;rn running=false;rn complete=false;rn percent=0;rn rn rn public void setRequest(HttpServletRequest request) rn this.request = request;rn rn public void setResponse(HttpServletResponse response) rn this.response = response;rn rn public synchronized boolean isComplete() rn return complete;rn rn public synchronized void setComplete(boolean complete) rn this.complete = complete;rn rn public synchronized int getPercent() rn return percent;rn rn public synchronized void setPercent(int percent) rn this.percent = percent;rn rn public synchronized boolean isRunning() rn return running;rn rn public synchronized void setRunning(boolean running) rn this.running = running;rn this.setState(running);rn rn public synchronized boolean isState() rn return state;rn rn public synchronized void setState(boolean state) rn this.state = state;rn rn /**rn * 判断能不能上传 后缀名,文件大小rn * @param suffixrn * @param sizern * @returnrn */rn public boolean canUpload(String suffix,int size)rn //System.out.println(suffix.toLowerCase());rn //System.out.println(size);rn Suffix suf=new SearchSuffix().getSuffixMember(suffix.toLowerCase());rn if(suf!=null&&suf.getSize().intValue()>=size)rn return true;rn rn return false;rn rn /**rn * 文件上传主要方法rn * @throws ServletExceptionrn * @throws IOExceptionrn */rn public synchronized void up() throws ServletException, IOExceptionrn String readLine;rn byte buf[]=new byte[512];rn rn ServletInputStream sis=request.getInputStream();rn rn int upFileSize=request.getContentLength();rn //开始读取rn int readLength=sis.readLine(buf,0,512);//去掉分隔行rn String boundary=new String(buf,0,readLength);rnrn int boundaryLength=boundary.length();//因为下面字节读取时会把回车换行符也读入rn rn readLength=sis.readLine(buf,0,512);rn readLine=new String(buf,0,readLength);rnrn int index=readLine.indexOf("filename=");//查找文件名rn String name=readLine.substring(index+10);rn name=name.substring(0, name.length()-3);//去掉末尾的分号,获得完整的文件名(注意中文名的显示)rn System.out.println(name);rn //查找文件后缀rn String suffix=name.substring(name.lastIndexOf(File.separator));rn suffix=suffix.substring(suffix.indexOf("."));rn rn //判断相应文件能不能传(后缀,大小)rn if(!canUpload(suffix, upFileSize))rn return ;rn rn //保存文件大小到session,供页面调用rn //request.getSession().setAttribute("upFileSize", new Integer(upFileSize));rn //设定新文件名rn String newName=Long.toString((new Date()).getTime());rn newName=newName+suffix;rn rn //设定文件 输出流rn String path=request.getRealPath("/")+"upfiles/";rn FileOutputStream out=new FileOutputStream(path+newName);rn int upedSize=0;rn //request.getSession().setAttribute("upedSize", new Integer(upedSize));rn tryrn //寻找文件起点rn while ( (readLength = sis.readLine(buf, 0, buf.length)) != -1) rn String s = new String(buf, 0, readLength);rn if ( (index = s.indexOf("Content-Type:")) != -1) rn break;rn rn //whilern sis.readLine(buf, 0, buf.length);//去掉一空行rn //读文件数据rn while((readLength = sis.readLine(buf, 0, buf.length)) != -1)rn upedSize+=readLength;rn this.setPercent((int)((upedSize/upFileSize)*100));//设置完成的百分数rn if ( (buf[0] == 45) && (buf[1] == 45) && (buf[2] == 45) && (buf[3] == 45) && (buf[4] == 45)) //若读结束rn break;rn rn out.write(buf,0,readLength);rn //out.flush();rn rn this.setPercent(100); //设置完成100rn this.setComplete(true); //设置完成标志rn catch(Exception e)rn e.printStackTrace();rn File tmp=new File(path+newName);rn tmp.delete();rn finallyrn out.close();rn sis.close();rn this.setRunning(false); //设置线程已经停止rn rn rn public void run()rn tryrn setRunning(true); //启动线程rn setComplete(false); //还没完成rn setPercent(0); //完成的了0%rn up(); //进入工作状态,上传rn catch(Exception e)rn e.printStackTrace();rn rn rnrnrnrnrn网页调用处代码rn<%@ page contentType="text/html; charset=gb2312" language="java" errorPage=""%>rnrnrn rn 文件上传rnrnrn<%session.removeAttribute("upFileBean"); %>rnrn<%rnupFileBean.setRequest(request);rnupFileBean.setResponse(response);rnnew Thread(upFileBean).start(); rn%>rnrnrnrnrn重启tomcat后第一次不管传什么文件都能正确上传rn但接下来传就出现如题的问题rn请高手指点一二。谢谢

憋了很久的问题-java.net.SocketTimeoutException: Read timed out

12-13

憋了很久的问题-java.net.SocketTimeoutException: Read timed outrnrnrn【问题描述】请求一个webservice偶尔会返回异常,如下:rnjava.net.SocketTimeoutException: Read timed outrn at java.net.SocketInputStream.socketRead0(Native Method)rn at java.net.SocketInputStream.read(SocketInputStream.java:129)rn at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)rn at java.io.BufferedInputStream.read(BufferedInputStream.java:235)rn at weblogic.net.http.MessageHeader.isHTTP(MessageHeader.java:220)rn at weblogic.net.http.MessageHeader.parseHeader(MessageHeader.java:143)rn at weblogic.net.http.HttpClient.parseHTTP(HttpClient.java:420)rn at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:345)rn at weblogic.net.http.SOAPHttpURLConnection.getInputStream(SOAPHttpURLConnection.java:31)rn at com.lingtu.lbs.util.WebUtil.requestLBMP(WebUtil.java:735)rn at com.lingtu.lbs.gis.webgis.doPost(webgis.java:99)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)rn at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)rn at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)rn at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)rn at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3211)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)rn at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)rn at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)rn at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)rn at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)rn at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)rn at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)rnrn这个异常并不是每次都抛出,而是当对方的webservice响应时间超过约2秒的时候才会抛出,我的程序并没有设置超时,而在家中的调试环境去访问这个webservice这种异常无法重现,已经排除了网络问题以及编码上的问题。所以我考虑是操作系统或weblogic设置不当(我方程序的weblogic容器,因为我们weblogic处理的http请求也很多)所引起,请大家帮我看看是什么原因?不胜感激!!!rnrn就是我在我们的weblogic中部署了一个war,这个war里面有一个类去请求另一个webservice,但是发现当对方返回响应的时候,有时我这边会抛出timeout异常,已经对网络进行抓包,发现我们产生异常的时候,对方的响应还没有发送完毕,我方主机就发送了断开连接的包。这个包我的程序肯定没有发,我怀疑是操作系统或者weblogic的原因。rnrn我用的是weblogic server9.2 有时请求和响应正常,有时请求响应不正常;请求不正常的时候抓包表现为:大约两秒左右,对方的响应还没有发送完毕,我方主机就发送了断开连接的包。rn

java.net.SocketTimeoutException: Async operation timed out

07-31

哪位大哥帮忙看看,出现这个异常是在部署环境中的日记中看到的,在启动本机的时候无论怎么操作都不会报异常,偏偏在部署环境中,但是部署环境中初始化加载页面的时候不报错,我再点击查询的时候经常会报这个异常,不过偶尔不报,请问是怎么回事?rn[code=Java][/code]rn at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)rn at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)rn at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:277)rn at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)rn at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)rn at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)rn at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)rn at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)rn at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)rn at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)rn at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)rn at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)rn at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)rn at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)rn at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)rn at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)rn at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)rn at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)rn at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)rn at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)rn at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)rn at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:997)rn at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:1043)rn at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:963)rn at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3933)rn at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)rn at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)rn at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)rn at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)rn at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)rn at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)rn at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)rn at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)rn at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)rn at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)rn at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)rn at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)rn at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)rn at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)rn at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)rn at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)rnCaused by: com.ibm.io.async.AsyncTimeoutException(Async operation timed out, [Timeout, rc=0])rn at com.ibm.io.async.AsyncException.(AsyncException.java:42)rn at com.ibm.io.async.AsyncTimeoutException.(AsyncTimeoutException.java:25)rn at com.ibm.io.async.AbstractAsyncFuture.waitForCompletion(AbstractAsyncFuture.java:315)rn at com.ibm.io.async.AsyncFuture.getByteCount(AsyncFuture.java:218)rn at com.ibm.ws.tcp.channel.impl.AioSocketIOChannel.readAIOSync(AioSocketIOChannel.java:215)rn at com.ibm.ws.tcp.channel.impl.AioTCPReadRequestContextImpl.processSyncReadRequest(AioTCPReadRequestContextImpl.java:182)rn ... 84 morern

axis1.x 客户端 _call.invoke 报错 java.net.SocketTimeoutException: Read timed out

09-23

如题:在线等rnrn2011-09-23 13:09:49,138 - [DEBUG] [HTTPSender] - java.net.SocketTimeoutException: Read timed outrn2011-09-23 13:09:49,140 - [DEBUG] rnrn[SOAPPart] - Enter: SOAPPart ctor(FORM_FAULT)rn2011-09-23 13:09:49,141 - [DEBUG] [ProjectResourceBundle] - rnrnorg.apache.axis.i18n.resource::handleGetObject(setMsgForm)rn2011-09-23 13:09:49,141 - [DEBUG] [SOAPPart] - Setting current message form rnrnto: FORM_FAULT (currentMessage is now org.apache.axis.AxisFault)rn2011-09-23 13:09:49,141 - [DEBUG] [SOAPPart] - Exit: SOAPPart ctor()rn2011-09-23 13:09:49,142 - [DEBUG] [ProjectResourceBundle] - org.apache.axis.i18n.resource::handleGetObject(toAxisFault00)rn2011-09-23 rnrn13:09:49,142 - [DEBUG] [Call] - Mapping Exception to AxisFaultrnAxisFaultrn faultCode: http://schemas.xmlsoap.org/soap/envelope/rnrnServer.userExceptionrn faultSubcode: rn faultString: java.net.SocketTimeoutException: Read timed outrn faultActor: rn faultNode: rn faultDetail: rn http://xml.apache.org/axis/stackTrace:java.net.SocketTimeoutException: Read timed outrn at rnrnjava.net.SocketInputStream.socketRead0(Native Method)rn at java.net.SocketInputStream.read(SocketInputStream.java:129)rn at rnrnjava.io.BufferedInputStream.fill(BufferedInputStream.java:218)rn at java.io.BufferedInputStream.read(BufferedInputStream.java:235)rn rnrnat org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSender.java:583)rn at rnrnorg.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)rn at org.apache.axis.strategies.InvocationStrategy.visitrnrn(InvocationStrategy.java:32)rn at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)rn at org.apache.axis.SimpleChain.invokernrn(SimpleChain.java:83)rn at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)rn at rnrnorg.apache.axis.client.Call.invokeEngine(Call.java:2784)rn at org.apache.axis.client.Call.invoke(Call.java:2767)rn at rnrnorg.apache.axis.client.Call.invoke(Call.java:2443)rn at org.apache.axis.client.Call.invoke(Call.java:2366)rn at rnrnorg.apache.axis.client.Call.invoke(Call.java:1812)rn at rnrncom.correction.wsclients.JDebugOrderFeedbackToNetHttpBindingStub.feedbackDebugOrder(JDebugOrderFeedbackToNetHttpBindingStub.java:107)rn rnrnat com.correction.wsclients.JDebugOrderFeedbackToNetPortTypeProxy.feedbackDebugOrder(JDebugOrderFeedbackToNetPortTypeProxy.java:53)rn rnrnat com.correction.services.impl.DebugOrderFeedbackToNetSrvImpl.feedbackDebugOrder(DebugOrderFeedbackToNetSrvImpl.java:60)rn at rnrncom.correction.services.impl.PersonCompanyModiSrvImpl.getITcheckCompanyModiModel(PersonCompanyModiSrvImpl.java:315)rn at rnrncom.correction.services.impl.PersonCompanyModiSrvImpl$$FastClassByCGLIB$$b13a089.invoke()rn at rnrnnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)rn at org.springframework.aop.framework.Cglib2AopProxyrnrn$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)rn at rnrnorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn at rnrnorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)rn at rnrnorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at rnrnorg.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)rn at rnrncom.correction.services.impl.PersonCompanyModiSrvImpl$$EnhancerByCGLIB$$b4da9d04.getITcheckCompanyModiModel()rn at rnrncom.correction.services.PersonCompanyModiCached.getPersonCompanyModi(PersonCompanyModiCached.java:88)rn at rnrncom.correction.services.PersonCompanyModiCached.getPersonCompanyModiMap(PersonCompanyModiCached.java:145)rn at rnrncom.correction.actions.FrontCorrectionAction.listPersonCompany(FrontCorrectionAction.java:100)rn at rnrnsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invokernrn(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn rnrnat java.lang.reflect.Method.invoke(Method.java:585)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionrnrn(DefaultActionInvocation.java:452)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnlyrnrn(DefaultActionInvocation.java:291)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn rnrnat com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn at rnrncom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn at rnrnorg.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at rnrncom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at rnrncom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at rnrncom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrnorg.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrnorg.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrnorg.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrnorg.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)rn at rnrncom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrnorg.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrncom.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn at rnrncom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at rnrnorg.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn

Read timed out

04-08

直接贴代码: rn客户端: rn[code=Java]rnrnpublic class Communicator rnrn private static final Log log = LogFactory.getLog(Communicator.class);rnrn private static String ADDRESS = "";rnrn private static int PORT = 0;rnrn /* 通讯对象 */rn private static Socket socket = null;rnrn private static BufferedReader in = null;rn private static PrintWriter out = null;rnrn rn public String sendMessage(String message) throws EbillsException rnrn String returnStr = "";rnrn try rnrn ADDRESS = "127.0.0.1";rn PORT = 8877;rn socket = new Socket(ADDRESS, PORT);rn socket.setSoTimeout(10000);rn in = new BufferedReader(new InputStreamReader(socketrn .getInputStream()));rn out = new PrintWriter(socket.getOutputStream());rn out.print(message);rn out.flush();rn returnStr = in.readLine();rnrn return returnStr;rn catch (Exception e) rn e.printStackTrace();rnrn finally rn releaseAll(out,in,socket);rn rnrn rn rn rn rn public static void main(String[] args) throws EbillsException rn Communicator communicator = new Communicator();rn communicator.sendMessage(new String("0000000000000000000"));rn rnrnrnrn[/code]rn服务端rn[code=Java]rnpublic class SoketServerTmp rn rn rn // 临时server rn rn public SoketServerTmp() throws Exception rn Socket client =null; rn try rn ServerSocket server=new ServerSocket(8877); rn client = server.accept(); rn BufferedReader in=new BufferedReader(new InputStreamReader(client.getInputStream())); rn PrintWriter out=new PrintWriter(client.getOutputStream()); rn rn while(true) rn String str=in.readLine(); rn //System.out.println(str); rn out.println("服务端has received...." + str); rn out.flush(); rn rn rn catch (Exception e) rn // TODO: handle exception rn finally rn client.close(); rn rn rn rn public static void main(String[] args) throws Exception rn new SoketServerTmp(); rn rn rnrnrnpublic class SoketServerTmp rnrn rn // 临时serverrnrn public SoketServerTmp() throws Exception rn Socket client =null;rn tryrn ServerSocket server=new ServerSocket(8877); rn client = server.accept(); rn BufferedReader in=new BufferedRead[code=Java][/code]er(new InputStreamReader(client.getInputStream())); rn PrintWriter out=new PrintWriter(client.getOutputStream()); rn rn while(true) rn String str=in.readLine(); rn //System.out.println(str); rn out.println("服务端has received...." + str); rn out.flush(); rn rn rn catch (Exception e) rn // TODO: handle exceptionrn finallyrn client.close();rn rn rn rn public static void main(String[] args) throws Exceptionrn new SoketServerTmp();rn rnrnrn[/code]rnrn问题,先启动服务端,然后启动客户端,怎么服务端一直都接收不了客户端的信息,然后还抛出 rnjava.net.SocketTimeoutException: Read timed out rnat java.net.SocketInputStream.socketRead0(Native Method) rnat java.net.SocketInputStream.read(SocketInputStream.java:129) rnat java.net.SocketInputStream.read(SocketInputStream.java:90) rnat sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:285) rnat sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182) rnat java.io.InputStreamReader.read(InputStreamReader.java:167) rnat java.io.BufferedReader.fill(BufferedReader.java:136) rnat java.io.BufferedReader.readLine(BufferedReader.java:299) rnat java.io.BufferedReader.readLine(BufferedReader.java:362) rnat com.amerisia.ebills.loanbycredit.ejb.Communicator.sendMessage(Communicator.java:61) rnat com.amerisia.ebills.loanbycredit.ejb.Communicator.main(Communicator.java:116) rn希望各位能够给解答一下 rnrn

org.apache.commons.fileupload.FileUploadException: Read timed out

11-16

求助,程序用的框架为struts2+hibernate+spring,运行环境为weblogic,用excel把数据导入数据库,如果excel中行数比较多(40000行左右),程序异常,后台报rnorg.apache.commons.fileupload.FileUploadException: Read timed outrn at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:381)rn at org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest.parse(JakartaMultiPartRequest.java:93)rn at org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper.(MultiPartRequestWrapper.java:75)rn at org.apache.struts2.dispatcher.Dispatcher.wrapRequest(Dispatcher.java:663)rn at org.apache.struts2.dispatcher.FilterDispatcher.prepareDispatcherAndWrapRequest(FilterDispatcher.java:327)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:367)rn at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)rn at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)rn at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3393)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)rn at weblogic.security.service.SecurityManager.runAs(Unknown Source)rn at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)rn at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)rn at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)rn at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)rn at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)rnCaused by: java.net.SocketTimeoutException: Read timed outrn。。。。。。。rnrn错误,但是行数少的时候没有问题,(20000行以下没问题,40000行有时有问题,有时没有问题)。我看了后台,数据已经导入到数据库中了,action的最后一条语句是插入日志,日志也插入了。就是报异常,不知道怎么回事。哪位大哥大姐遇到过这样的问题,怎么解决的,望不吝告知,先谢过了。

socket的Read timed out问题

05-18

[code=Java]rnprivate static String sendSynMsg(String ipAddr, byte[] datas) throws Exception rn //解析服务器地址和端口号 rn int dotPos = ipAddr.indexOf(':'); rn String ip = ipAddr.substring(0, dotPos).trim(); rn int port = Integer.parseInt(ipAddr.substring(dotPos+1).trim()); rn InetSocketAddress endpoint = new InetSocketAddress(ip , port); rn System.out.println("ip:"+ip+"port:"+port);rn Socket socket = null; rn OutputStream out = null; rn InputStream in = null; rn try rn socket = new Socket(); rn //设置发送逗留时间2秒 rn socket.setSoLinger(true, 2); rn //设置InputStream上调用 read()阻塞超时时间2秒 rn socket.setSoTimeout(2000); rn //设置socket发包缓冲为32k; rn socket.setSendBufferSize(32*1024); rn //设置socket底层接收缓冲为32k rn socket.setReceiveBufferSize(32*1024); rn //关闭Nagle算法.立即发包 rn socket.setTcpNoDelay(true); rn //连接服务器 rn socket.connect(endpoint); rn //获取输出输入流 rn out = socket.getOutputStream(); rn in = socket.getInputStream(); rn //输出请求 rn out.write(datas); rn out.flush(); rn //接收应答 rn BufferedReader br = new BufferedReader( new InputStreamReader(in) , 4096); rn StringWriter received = new StringWriter(4096); rn char[] charBuf = new char[4096]; rn int size = 0; rn char lastChar = 0; rn do rn size = br.read(charBuf , 0 , 4096); rn lastChar = charBuf[size-1]; rn if(lastChar == 0) rn received.write(charBuf, 0, size - 1); rn rn //System.out.println(received.toString()); rn while(lastChar != 0); rn rn return received.toString(); rn rn finally rn if (out != null) rn try rn out.close(); rn catch(Exception ex) rn ex.printStackTrace(); rn rn rn if (in != null) rn try rn in.close(); rn catch(Exception ex) rn ex.printStackTrace(); rn rn rn if (socket != null) rn try rn socket.close(); rn catch(Exception ex) rn ex.printStackTrace(); rn rn rn rn rnrnpublic static void main(String[] args) rn byte[] charBuf = new byte[4096]; rnrn try rn sendSynMsg("132.97.101.22:7001",charBuf);rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rnrnrn rn[/code]rn请问下,传参数 sendSynMsg("132.97.10.55:7001",charBuf);第二个参数该怎么传呢??rn

redis SocketTimeoutException: Read timed out

08-04

具体报错信息如下:rn[code=java]redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed outrn at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:201) ~[jedis-2.6.2.jar:na]rn at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40) ~[jedis-2.6.2.jar:na]rn at redis.clients.jedis.Protocol.process(Protocol.java:128) ~[jedis-2.6.2.jar:na]rn at redis.clients.jedis.Protocol.read(Protocol.java:192) ~[jedis-2.6.2.jar:na]rn at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:282) ~[jedis-2.6.2.jar:na]rn at redis.clients.jedis.Connection.getOne(Connection.java:264) ~[jedis-2.6.2.jar:na]rn at redis.clients.jedis.ShardedJedisPipeline.syncAndReturnAll(ShardedJedisPipeline.java:57) ~[jedis-2.6.2.jar:na]rn at com.tuniu.nfw.search.base.redis.acc.impl.RedisPipelinedImpl.batchSetExpirePipelined(RedisPipelinedImpl.java:147) ~[RedisPipelinedImpl.class:na]rn at com.tuniu.nfw.search.base.redis.acc.impl.RedisProxyImpl.mSetExpire(RedisProxyImpl.java:264) ~[RedisProxyImpl.class:na]rn at com.tuniu.nfw.search.business.dao.impl.TripRedisDaoImpl.saveTrip(TripRedisDaoImpl.java:81) ~[TripRedisDaoImpl.class:na]rn at com.tuniu.nfw.search.business.service.impl.DataStructureServiceImpl$1.run(DataStructureServiceImpl.java:87) [DataStructureServiceImpl$1.class:na]rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_30]rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_30]rn at java.lang.Thread.run(Thread.java:662) [na:1.6.0_30]rnCaused by: java.net.SocketTimeoutException: Read timed outrn at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.6.0_30]rn at java.net.SocketInputStream.read(SocketInputStream.java:129) ~[na:1.6.0_30]rn at java.net.SocketInputStream.read(SocketInputStream.java:90) ~[na:1.6.0_30]rn at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:195) ~[jedis-2.6.2.jar:na]rn ... 13 common frames omitted[/code]rnrn并发比较多的时候和数据量比较多的时候会 触发这个错误,网上看了些,有的说是 redis使用tcp协议,网卡带宽可能不够,有的说redis的超时时间设置的比较短的问题,那么如果把redis的超时时间设置稍微长一点(默认2s,我设置的是0.2s),比如3s,会出现一些性能方面的问题么?rn这个问题根源是什么?怎么解决?

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试