Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RMI + LAN = trouble !!

843793Apr 21 2006 — edited Apr 23 2006
my server is a linux machine with ip 192.168.100.76.
i have made an email service in which my smtp and pop3 are installed in the linux server
i have made a client application which fetches the mail from the server..

Now the problem

we know that the stub always gets downloaded from the server..
this procedure is only happening when the client executes in the server itself

but when the client is ran on a LAN it is not able to download it



the server code is this...
import java.rmi.*;





public class KONMain {



	public static void main(String[] arg) {

		try {

			

//			the code for starting the rmi registry			

			

//			System.out.println("RMI registry started");

			if(System.getSecurityManager()==null)

				System.setSecurityManager(new RMISecurityManager());

				

			java.rmi.registry.LocateRegistry.createRegistry(1099);

			Naming.rebind("aikon", new KONMail(arg[0]));

			System.out.println("Server has started");

			new TJMultiServer();

		} catch (Exception e) {

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

		}

	}

}
the server is started as

java -Djava.rmi.server.codebase=file:///home/aikon/aikon/kon_server/ -Djava.security.policy=policy KONMain <ip>

in this way the server is started

when starting the client
it only fetches the _stub from the server repository when started in the same machine

this criterion fails when the client is ran in another machine

!!!!!!!!!!

the client code that theoritically fetches the stub :p
{
							if(System.getSecurityManager()==null)
								System.setSecurityManager(new RMISecurityManager());
							KONInterface ke = (KONInterface)Naming.lookup("//" + ipAddr +"/aikon");
							boolean x = ke.authenticate(username,password);
							
							if(x==true){
								new KONFrame(username,password,ipAddr);
								//new TJInterface();
								authFrame.dispose();
							}
							else{
								authFrame.dispose();
								new KONAuthenticate("                    Invalid user name password");
							}
						}
the starting statement for client

java -Djava.security.policy=policy KONAuthenticate <ip of server>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2006
Added on Apr 21 2006
1 comment
92 views