[英]RMI rebind JRMP error
Since a few days i get the following error when I try to run my java server application: 几天以来,当我尝试运行Java服务器应用程序时出现以下错误:
SEVERE: Stratego server exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
My main method looks like: 我的主要方法如下:
Stratego stratego = new Stratego();
try
{
if (System.getProperty("java.security.policy") == null)
{
System.setProperty("java.security.policy", "src/Server/Policy/server.policy");
}
if (System.getProperty("java.rmi.server.codebase") == null)
{
System.setProperty("java.rmi.server.codebase", "file:/D:/.../build/classes");
}
if (System.getSecurityManager() == null)
{
System.setSecurityManager(new RMISecurityManager());
}
LocateRegistry.createRegistry(9292);
Naming.rebind("rmi://localhost:9292/StrategoServer", stratego);
Logger.getLogger(Stratego.class.getName()).info("Stratego server ready");
}
catch (Exception e)
{
Logger.getLogger(Stratego.class.getName()).log(Level.SEVERE, "Stratego server exception: {0}", e.toString());
}
The policy, codebase and SecurityManager are new but when i comment them out, I still get this error. 该策略,代码库和SecurityManager是新的,但是当我将其注释掉时,仍然出现此错误。 It all worked well before.
以前一切都很好。 Can anyone tell me why?
谁能告诉我为什么?
Oh btw, I use Windows 7 x64 and JDK 7 哦,顺便说一句,我使用Windows 7 x64和JDK 7
It turned out that the port was occupied (don't know how). 原来,该端口已被占用(不知道如何)。 When I changed the port from 9292 to 9288 it worked.
当我将端口从9292更改为9288时,它起作用了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.