Пример кода:
ServiceTemplate tmp1 = new ServiceTemplate(null, classes, null);
try {
/* if(System.getSecurityManager() == null)
System.setSecurityManager(new RMISecurityManager());*/
thisIp = InetAddress.getLocalHost();
LookupLocator locator = new LookupLocator("jini://"+thisIp.getHostName().toString());
ServiceRegistrar sr = locator.getRegistrar();
JavaSpace space = (JavaSpace)sr.lookup(tmp1);
System.out.println("Success");
}
Обнаружена ошибка в [ServiceRegistrar sr = locator.getRegistrar ();]
в котором говорится
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:209)
at net.jini.core.discovery.LookupLocator.getRegistrar(LookupLocator.java:328)
at net.jini.core.discovery.LookupLocator.getRegistrar(LookupLocator.java:286)
at MessageEntry.main(MessageEntry.java:34)
Я новичок в технологиях JavaSpace, помогите мне.
Заранее спасибо
Jeetesh.N