Hi i'm a student of Roma 3 University i have this trouble: I write a Server jini and, when It runs,it don't execute the command line sign with "***************" in the code below: package ProgettoJini; import net.jini.core.entry.*; import net.jini.lookup.entry.*; import net.jini.lookup.JoinManager; import net.jini.lease.*; import net.jini.core.lookup.*; import java.io.*; import net.jini.core.discovery.*; import java.net.*; import java.rmi.server.*; import java.rmi.*; public class ServerJini implements Interfaccia { //implementazione del servio mostrato dall'interfaccia public void ServioHello(){ System.out.println("Jini funziona!!!!!!!!!!!!!!!!!"); } public static void main(String[] args) throws IOException,MalformedURLException,ClassNotFoundException{ int sPort; String sHost; Entry[] att; att= new Entry[10]; att[1]= new Name("ServerJini"); ServiceID id; ServiceRegistrar reg; System.setSecurityManager(new RMISecurityManager()); //descrizione del servizio ServioHello da registrare nel lookup service // Entry[] attributi; // attributi = new Entry[1];
long a,b; a=0; b=1; try{ LookupLocator look; look = new LookupLocator("jini://localhost"); sHost =look.getHost(); sPort =look.getPort(); System.out.println("Host del Server "+ sHost ); System.out.println("Porta del Server "+ sPort); ServerJini Server = new ServerJini(); reg = look.getRegistrar(); System.out.println("kkkkk "); **********************
id = reg.getServiceID(); JoinManager join = new JoinManager(Server,att,id,null,new LeaseRenewalManager()); System.out.println(join); } catch (Exception m){ System.out.println(m); }