iteye_3982
2012-03-08 09:45
浏览 648

RMI连接问题

先贴下异常信息:
Lookup of RMI stub failed; nested exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketException: Connection reset
org.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 more
Caused 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哥哥指点下

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • suziwen 2012-03-08 09:59
    已采纳

    看看这个或许有帮助

    [url]http://blog.csdn.net/guowake/article/details/6615728[/url]

    还有看看服务器防火墙是不是也做了限制

    打赏 评论
  • 王启军 2012-03-08 15:52

    linux默认1024个连接

    大概多少个rmi服务,每个服务峰值连接多少,当然这个限制可以修改

    打赏 评论
  • 王启军 2012-03-08 17:19

    当你发布第13个的时候,telnet一下是否有问题,是不是端口被占用了?你的异常是客户端报的,你看服务端是否启动了?有没有什么异常

    打赏 评论

相关推荐 更多相似问题