RMI connection refused on localhost

后端 未结 1 1780
孤城傲影
孤城傲影 2020-11-28 17:02

I am trying to learn RMI coding and when I run server side of RMI I get connection refused. This is my server main method

public static void main(String[] ar         


        
相关标签:
1条回答
  • 2020-11-28 17:39

    The target of Naming.rebind() is the RMI Registry. It has to be running. It wasn't running. So you couldn't connect to it. So you got a ConnectException.

    I believe that the code for Implementation does not matter as it simply is the implemented interface that will run the code.

    This is both meaningless and irrelevant. Interfaces do not 'run the code'. Methods in classes run the code, and in this case the implementation class runs the code. However your problem is not in 'run[ning] the code', it is in connecting to the Registry.

    0 讨论(0)
提交回复
热议问题