0
由於幾天我碰到下面的錯誤,當我嘗試運行我的Java服務器應用程序:RMI重新綁定JRMP錯誤
SEVERE: Stratego server exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
我的主要方法是這樣的:
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());
}
政策,代碼庫和SecurityManager是新的,但當我評論他們,我仍然得到這個錯誤。這一切都運行良好。 誰能告訴我爲什麼?
哦順便說一句,我使用的是Windows 7 x64和JDK 7