Ubuntu下RMI Server 抛出java.rmi.ConnectException: Connection refused to host: 127.0.0.1解决办法
2011-07-05 23:29
567 查看
需要启动rmiregistry
参见
http://ubuntuforums.org/showthread.php?t=1278660
The actual reason is the rmiregistry service on your machine is not running......u hav two ways to solve it......
1) start terminal, type "rmiregistry" (without quotes) & hit enter. it will look like something has hanged up....but the service has been started........run your code now & things will work (only till the terminal looks in hanging state). closing the terminal or stopping the rmiregistry by ctrl+c will stop it.
2) second way is to add following snippet in your code -
static
{
try
{
LocateRegistry.createRegistry(1099);
}
catch (RemoteException e)
{
e.printStackTrace();
}
}
this will start the service till your code is running (on the default port 1099).
参见
http://ubuntuforums.org/showthread.php?t=1278660
The actual reason is the rmiregistry service on your machine is not running......u hav two ways to solve it......
1) start terminal, type "rmiregistry" (without quotes) & hit enter. it will look like something has hanged up....but the service has been started........run your code now & things will work (only till the terminal looks in hanging state). closing the terminal or stopping the rmiregistry by ctrl+c will stop it.
2) second way is to add following snippet in your code -
static
{
try
{
LocateRegistry.createRegistry(1099);
}
catch (RemoteException e)
{
e.printStackTrace();
}
}
this will start the service till your code is running (on the default port 1099).
相关文章推荐
- 调用远程主机上的RMI服务时抛出java.rmi.ConnectException: Connection refused to host: 127.0.0.1异常原因及解决方案
- 调用远程主机上的RMI服务时抛出java.rmi.ConnectException: Connection refused to host: 127.0.0.1异常原因及解决方案
- 调用远程主机上的RMI服务时抛出java.rmi.ConnectException: Connection refused to host: 127.0.0.1异常原因及解决方案
- 调用远程主机上的RMI服务时抛出java.rmi.ConnectException: Connection refused to host: 127.0.0.1异常原因及解决方案
- 调用远程主机上的RMI服务时抛出java.rmi.ConnectException: Connection refused to host: 127.0.0.1异常原因及解决方案
- Jboss客户端连接EJB,javax.naming.CommunicationException [java.rmi.ConnectException: Connection refused to host: 127.0.0.1]异常解决
- java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.Con
- 解决JMX连接异常 java.rmi.ConnectException: Connection refused to host: 127.0.1.1
- Java RMI:rmi Connection refused to host: 127.0.0.1异常解决
- java.rmi.ConnectException: Connection refused to host: 127.0.0.1
- java.rmi.ConnectException: Connection refused to host: 127.0.0.1解决方案 RMI调用connet refused
- kafka manger 报错java.rmi.ConnectException: Connection refused to host: 127.0.0.1
- Spring RMI错误:java.rmi.ConnectException: Connection refused to host: 127.0.0.1
- java.rmi.ConnectException: Connection refused to host: 127.0.0.1
- 在Ubuntu中ssh报错: connect to host localhost port 22: Connection refused 解决办法
- Ubuntu 安装配置SSH(ssh: connect to host localhost port 22: Connection refused问题的解决)
- 启动tomcat时 错误: 代理抛出异常 : java.rmi.server.ExportException: Port already in use: 1099的解决办法
- spring RMI demo运行报错-nested exception is java.rmi.ConnectException: Connection refused to host: local
- java.rmi.ConnectException: Connection refused to host: