The Artima Developer Community
Sponsored Link

Jini Forum
Finding JavaSpace

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
BN

Posts: 2
Nickname: druuna
Registered: Apr, 2002

Finding JavaSpace Posted: Apr 7, 2002 10:46 AM
Reply to this message Reply
Advertisement
Hi!

After I (finally!) got all required Jini services running (RMID, WebServer, Reggie, Mahalo_TxnManager and TransientSpace), I tried running a simple program just to see if everything's working properly. I wanted to perform a lookup on a LUS's registrar and find JavaSpace, or any other service, so I used ServiceTemplate(null,null,null). But, the only thing it finds is reggie's proxy. It reports that there are no other services running.
How come it doesn't find transaction manager, or JavaSpace, although they seem to have performed join successfully?
I hope someone helps! Thanx!

Here's a program listing:


import net.jini.core.lookup.*;
import net.jini.core.discovery.*;
import com.sun.jini.lookup.*;
import net.jini.space.*;

class first
{
public static void main (String[] args)
{

LookupLocator lookup;
ServiceRegistrar registrar;
ServiceTemplate template;

try
{

lookup = new LookupLocator ("jini://localhost");
registrar = lookup.getRegistrar();
template = new ServiceTemplate (null, null, null);
ServiceMatches services = registrar.lookup (template,10);

System.out.println ("Number of matches found: " + services.items.length);
for (int i=0;i<services.items.length;i++)
System.out.println ("Service "+i+" : " + services.items.service);

}
catch (Exception e)
{
System.out.println ("client: first.main() exception: " + e);
}

}
}


The output I get is :

Number of matches found: 1
Service 0 : com.sun.jini.reggie.RegistrarProxy@624457bc


If I use real IP number and port instead of localhost in creating LookupLocator I get this error message:

bad request " &#9786;" from jazz:1368
java.net.SocketException: Connection aborted by peer: socket write error
at java.net.SocketOutputStream.socketWrite(Native Method)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.DataOutputStream.writeBytes(Unknown Source)
at com.sun.jini.tool.ClassServer$Task.run(ClassServer.java:243)

Topic: waiting for JavaSpaces Previous Topic   Next Topic Topic: Where to begin???

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use