问题描述
先贴下异常信息:Lookup of RMI stub failed; nested exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketException: Connection resetorg.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketException: Connection reset at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:215) at org.springframework.remoting.rmi.RmiClientInterceptor.getStub(RmiClientInterceptor.java:237) at org.springframework.remoting.rmi.RmiClientInterceptor.invoke(RmiClientInterceptor.java:257) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy2.handleEvent(Unknown Source) at com.ffcs.oss.snms.fm.services.dataservice.EventSenderImpl.handleEvent(EventSenderImpl.java:219) at com.ffcs.oss.snms.fm.services.dataservice.EventSenderImpl.sendEventTask(EventSenderImpl.java:191) at com.ffcs.oss.snms.fm.services.dataservice.EventSenderImpl.access$0(EventSenderImpl.java:173) at com.ffcs.oss.snms.fm.services.dataservice.EventSenderImpl$ResSendTask.run(EventSenderImpl.java:166) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketException: Connection reset at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:286) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184) at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at java.rmi.Naming.lookup(Naming.java:84) at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:200) ... 18 moreCaused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:237) at java.io.DataInputStream.readByte(DataInputStream.java:248) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:228) ... 23 more问题描述:在同一台linux服务器同时发布N个RMI服务,当这个N大于某个数据时,有的服务被调用时就报了这个异常,调用该服务的客户端有的连接正常,有的连接会报这个错误,我关掉了任意一个正常或非正常的服务,其他所有服务都通了,这个问题貌似是linux对连接数做了限制吗?有知道的rmi哥哥或者linux哥哥指点下 问题补充:suziwen 写道
解决方案
看看这个或许有帮助http://blog.csdn.net/guowake/article/details/6615728还有看看服务器防火墙是不是也做了限制
解决方案二:
当你发布第13个的时候,telnet一下是否有问题,是不是端口被占用了?你的异常是客户端报的,你看服务端是否启动了?有没有什么异常
解决方案三:
linux默认1024个连接大概多少个rmi服务,每个服务峰值连接多少,当然这个限制可以修改