Tag: restart

重启自己 – 我可以从头开始重新初始化一切吗?

我有这样的事情: public static final String path; static { path = loadProperties(“config.conf”).getProperty(“path”); } public static void main(String… args) { // … do stuff (starting threads that reads the final path variable) // someone want’s to update the path (in the config.conf file) restart(); // ??? } 我想重新初始化JVM再次调用静态初始化程序,然后是main(…) ! 可以吗?

服务器重启后重新连接RMI客户端

我有一个RMI服务器和一个桌面RMI客户端。 当我重新启动服务器时,我在客户端遇到错误。 是否可以重新启动RMI连接而无需重新启动客户端? [编辑]这是堆栈跟踪: java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx; nested exception is: java.net.ConnectException: Connection refused: connect at …user code… Caused by: java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx; nested exception is: java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:179) at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132) at $Proxy0.search(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) […]