The Artima Developer Community
Sponsored Link

Legacy Jini Forum
Adding UIs to Jini Services

Advertisement

Advertisement

This page contains an archived post to the Jini Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Unicast Discovery Problems

Posted by Ram on September 20, 2000 at 2:45 PM

Dear Sir,

I was working on a simple Unicast discovery using Jini . I encountered a
Strange problem. Here is the problem description

1) I am using Jini1-0-1
2)I have given permission java.security.AllPermission in the lookup policy
file and everywhere else
3) I started the web server pointing to jini1_0_1/lib
4)I started rmid (annulling the latest security option)
5) I started the look up with no problem.

Now after all this setting up, I started the Unicast discovery program attached at the end). After some time( I varied the value of (source codeTime out from 1 minute to 5 minutes) the unicast connection exits with a message
"Error getting service proxy: Read timed out"

The message on the screen where look up service was running was this

"java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite(Native Method)
at java.net.SocketOutputStream.write(SocketOutputStream.java:66
at java.io.DataOutputStream.writeBytes(DataOutputStream.java:26
at com.sun.jini.tool.ClassServer$Task.run(ClassServer.java:218)"

Could you please let me know what this means. The unicast discovery is able to contact the lookup service but unfortunately cannot get a proxy of the look up.

My conjecture is this, I noticed the same problem with RMI and think it could probably be because of the simple Http web server that comes with
Jini. Could you please try it out and let me know.

this is the source code for the locator.

public class LocatorExample {
public LocatorExample() {
}

public ServiceRegistrar getRegistrar(String url)
throws MalformedURLException, IOException, ClassNotFoundException
{
LookupLocator loc = new LookupLocator(url);
System.out.println("Host: " + loc.getHost());
System.out.println("Port: " + loc.getPort());
return loc.getRegistrar();
}
public static void main(String[] args) {
if (args.length != 1) {
System.out.println("Usage: LocatorExample ");
System.exit(1);
}

String[] Public = new String[1];
Public[0] = " ";
LocatorExample loc = new LocatorExample();
ServiceRegistrar reg;
DiscoveryExample disc = new DiscoveryExample(Public);

try {
reg = loc.getRegistrar(args[0]);

System.out.println("Got registrar: ");
// System.out.println("\tURL: " + disc.getURL(reg));
// System.out.println("\tID: " + reg.getServiceID());
// System.out.println("\tGroups: " + disc.getGroups(reg));
} catch (MalformedURLException ex) {
System.err.println("Malformed URL. Use a valid jini URL.");
System.exit(1);
} catch (Exception ex) {
System.err.println("Error getting service proxy: " +
ex.getMessage());
System.exit(1);
}
}
}

Thank You
Ram




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us