Server connection failed if I dont use default port
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sandeep_pathuri
Posted On:   Friday, June 24, 2005 03:35 PM

I am a newbee. I started the rmiregistry and then the server. If I use the default rmiregistry it work fine. If I use rmiregistry 10001, i.e. if I change the port, the server connection fails. THis is my server side code: import java.rmi.Naming; public class HelloServer { public static void main (String[] argv) { try { Naming.rebind ("Hello", new Hello ("Hello, world!")); System.out.println ("Hello Server is ready."); } catch (Exception e) { System.out.println ("Hello Server failed: " + e); } } } Any Help...... Thanks    More>>

I am a newbee. I started the rmiregistry and then the server. If I use the default rmiregistry it work fine. If I use rmiregistry 10001, i.e. if I change the port, the server connection fails. THis is my server side code:

import java.rmi.Naming;


public class HelloServer

{

public static void main (String[] argv)

{

try {

Naming.rebind ("Hello", new Hello ("Hello, world!"));

System.out.println ("Hello Server is ready.");

}

catch (Exception e) {

System.out.println ("Hello Server failed: " + e);

}

}

}


Any Help......


Thanks

   <<Less

Re: Server connection failed if I dont use default port

Posted By:   anoop_m2  
Posted On:   Friday, August 12, 2005 04:44 AM

sandeep
if u r planing to use port other than rmi default port 1099, u need to specify it in naming.rebind and also must to specify the port while starting rmi registry in the console like start rmiregistry .
anoop192@rediffmail.com

Re: Server connection failed if I dont use default port

Posted By:   ankush_purwar  
Posted On:   Monday, June 27, 2005 06:28 AM

You should always use "Hello" as
"rmi://+argv[0]+":"+argv[1]+"/Hello"
where argv[0] represents machinename or IPAddress
and argv[1] represents port on which your rmiregistry is
running on.

Re: Server connection failed if I dont use default port

Posted By:   sandeep_pathuri  
Posted On:   Friday, June 24, 2005 03:41 PM

Sorry for asking a silly question. I got it resolved by myself .... Just added the ip_address:[new_port] in the "Naming.rebind"

Thanks
About | Sitemap | Contact