I use java.rmi.registry.LocateRegistry.createRegistry(int port) method in my server, but if the port is not 1099, i start server to get following error: java.rmi.ConnectException: Connection refused to host:172.16.2.44;nested exception is: java.net.ConnectException: Connection refused: connect if i use the port "1099" ,the error is not throw. why??
Hi Shao, What port are you trying to use? Several things can cause a port connection to be refused. The most common two are: 1) Using a port number below 1024. Any port below 1024 requires super user or administrative access. 2) There is already a service bound to the port. Hope this helps, Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Thanks Michael for reply. i check my code and find some error in Naming.rebind(). my original code: Naming.rebind("Connection",connection); and modify: Naming.rebind("//localhost ort/Connection",connection); the program run well.
Originally posted by shao zhimin: Samual : the JEditorPane code and the document must be in the same directory, is right?? If them pack the different directory, how to do it??
No they can be in different directories. You should be able to access it. For testing create one html file inside your root directory and name it some weird name. Package the jar file and try this:- URL url = this.getClass().getResource("weird.html"); If you move it in a directory then you need to chage the abv as getResource("dir/weird.html");
Easy way is two create you own html fiule in the root and put in the hyperlinks for the respective html files.