几天以来,当我尝试运行我的 java 服务器应用程序时,我收到以下错误:
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