欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

java.rmi.connectioexception: error during jrmp connection establishment,该怎么解决

更新时间: 2014-01-05 01:57:59 责任编辑: Author_N1

 

java.rmi.ConnectIOException: error during JRMP connection establishment
描述:我有个类代码如下,在main方法中调用,每10秒钟调用一次,开始运行没问题,运行一天左右就报错
public void excuteAlarm() throws ParserConfigurationException,
SAXException, IOException {
setCtx(new FileSystemXmlApplicationContext("classpath:applicationContext.xml"));
setEntityManagerFactory((EntityManagerFactory) ctx.getBean("entityManagerFactory"));
EntityManager em = entityManagerFactory.createEntityManager();
// 取得监测数据
String COUNT_ALL = "。。。。。。。。。 ";
 
int count = ((Number) em.createNativeQuery(COUNT_ALL).getResultList().get(0)).intValue();
 
if (em.isOpen()) {
em.close();
}
EntityManagerFactoryUtils.closeEntityManager(em);
 
System.out.println("要处理的所有对象总数" + count);
 
List<RmiService> rmiServiceList =getPropertyValue();//取到服务的个数

if(rmiServiceList == null || rmiServiceList.size() == 0){
logger.warn("找不到运行状态的服务器");
}else{
int ServiceCount = rmiServiceList.size();
int eachService = count / ServiceCount;
for (int i = 0; i < ServiceCount; i++) {
int[] wellData = { i*eachService+1, (i+1)*eachService };
if(i == (ServiceCount - 1)){
wellData[0] = i*eachService+1;
wellData[1] = count;
}
String[] ThreadPoolParam = { "1", "4", "4", "1" };

AlarmClientThread  alarmClientThread = new AlarmClientThread(ThreadPoolParam,wellData,rmiServiceList.get(i).getUrl());
Thread thread =new Thread(alarmClientThread);
logger.info("转换从"+wellData[0]+"到"+wellData[1]);
thread.start();
}
 
}
}


报错如下各位大神求解!
2013-12-04 14:45:23,158 [Thread-2] ERROR [com.cnpc.a11.A11RealTimeDataService.se
rvice.thread.AlarmClientThread] - error
java.rmi.ConnectIOException: error during JRMP connection establishment; nested
exception is:
        java.net.SocketTimeoutException: Read timed out
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:304
)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:340)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at java.rmi.Naming.lookup(Naming.java:101)
        at com.cnpc.a11.A11RealTimeDataService.service.thread.AlarmClientThread.
run(AlarmClientThread.java:28)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
        at java.io.DataInputStream.readByte(DataInputStream.java:265)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:246
)
        ... 6 more
--参考方法--
连接超过了1024
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 01:57:59
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/3760/
本文WWW.DOC100.NET DOC100.NET版权所有。