The Artima Developer Community
Sponsored Link

Jini Forum
Why can't LookupDiscoveryService (i.e. Fiddler) be found?

3 replies on 1 page. Most recent reply: Sep 11, 2002 6:21 AM by Michael Wiedmer

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 3 replies on 1 page
Robert Paris

Posts: 3
Nickname: jiniboy
Registered: Sep, 2002

Why can't LookupDiscoveryService (i.e. Fiddler) be found? Posted: Sep 5, 2002 2:12 PM
Reply to this message Reply
Advertisement
I'm running a simple program that needs to find a LookupDiscoveryService. I have Activatible-Fiddler (from sun) running on the same computer as the program I'm testing. For some reason when I use the following code, it always times out (or at least it returns null):

...elided...
ServiceDiscoveryManager sdMgr = new ServiceDiscoveryManager(null,null);
Class[] types = new Class[] { LookupDiscoveryService.class };
ServiceTemplate tmpl = new ServiceTemplate( null, types, null );
ServiceItem ldsItem = sdMgr.lookup( tmpl, null, 1*60*1000);

ldsItem is always null, and it takes a full minute before it returns. Any idea why? I have Fiddler registered in the public group, and as you can see above, it should be able to find the lookup easily through mutlicast since they're on the same computer.

Thanks in advance for any time/help!
- Jini Boy


Robert Paris

Posts: 3
Nickname: jiniboy
Registered: Sep, 2002

Re: Why can't LookupDiscoveryService (i.e. Fiddler) be found? Posted: Sep 5, 2002 2:33 PM
Reply to this message Reply
OK, I partially solved the problem: I found someone else's code that after creating a ServiceDiscoveryManager, called Thread.sleep(10000L). I did that, and it found the services!! Why is this? If I have to do that every time, what do I do if the time to wait is 10002L one time and <10000 another time? Waiting an arbitrary amount of time seems a bit buggy and risky way to make that class.

Second problem:

Now that I found the service, I'm getting a new error:

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.sun.jini.lease.landlord.LandlordLease
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.sun.jini.lease.landlord.LandlordLease
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.sun.jini.lease.landlord.LandlordLease
java.lang.ClassNotFoundException: com.sun.jini.lease.landlord.LandlordLease
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall .java:245)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at sun.rmi.server.ActivatableRef.invoke(ActivatableRef.java:120)
at com.sun.jini.norm.NormServerImpl_Stub.renewFor(Unknown Source)
at com.sun.jini.norm.SetProxy.renewFor(SetProxy.java:127)
at com.sun.jini.norm.SetProxy.renewFor(SetProxy.java:95)
at Collector.setupLeaseRenewals(Unknown Source)
at Collector.main(Unknown Source)


Something similar happened to me once before and I couldn't figure out how to solve this. Why can't Norm find those classes? How do I make Norm find the classes? How can I anticipate problems like this in the future? Why does it happen? I mean, com.sun.jini.lease.landlord.LandlordLease is a sun class, so shouldn't Norm be able to find it?

Any help on this is GREATLY appreciated.

Thanks!

Robert Paris

Posts: 3
Nickname: jiniboy
Registered: Sep, 2002

Re: Why can't LookupDiscoveryService (i.e. Fiddler) be found? Posted: Sep 6, 2002 6:49 AM
Reply to this message Reply
I am setting the codebase, and I can see it requests the jar file from there so I know I set it correctly. I did a work-around to solve the second problem, but I know I shouldn't have to do that (as explained below) so that problem really still exists. But now that I at least got that to "work" here is what happens next:
When I turn on debugging (using the following):

-Djava.security.debug=access,failure
-Dcom.sun.jini.sdm.debug=true
-Dcom.sun.jini.reggie.proxy.debug=true
-Dnet.jini.discovery.debug=true

I get the following error three times:

java.io.IOException: port number out of range 86507520
at net.jini.discovery.IncomingMulticastAnnouncement.<init> (IncomingMulticastAnnouncement.java:83)
at net.jini.discovery.LookupDiscovery$AnnouncementListener.run(LookupDiscovery.jav a:315)

However, my app. is able to find the LookupDiscoveryService anyways and call methods successfully on it. I then create an EventMailbox registration (using mercury) and use its listener to be the listener passed to the method "register" on Fiddler. However, when I later check the mailbox for any events, nothing is raised.

So continuing from the earlier problem in this email thread, I know have four problems:

1. I have to "sleep" for a bit or the services cannot be found

2. Norm is unable to find the LandLord Lease class, which is the class returned as the Listener on the MailboxRegistration.getlease()

I can make it work by adding sun-util.jar to my application's
codebase, but I shouldn't have to! I should only have to deal
with the interface "Lease", otherwise I can't program to the
Jini API but have to program to every implementation.

3. I get the error (only when debugging is on) of port number out of range, but it still finds the service. Does this matter?

4. Event though the Mailbox Listener was successfully passed to "regsiter" (got back a non-null LookupDiscoveryRegistration), no events are ever sent to my mailbox.

If anyone can see what I'm doing wrong in any of these steps that would be a huge help!

Thanks!

Robert

Michael Wiedmer

Posts: 15
Nickname: micks
Registered: Aug, 2002

Re: Why can't LookupDiscoveryService (i.e. Fiddler) be found? Posted: Sep 11, 2002 6:21 AM
Reply to this message Reply
Hi,

I've been working on similar things and ran into similar problems (surprise!),; however, here are some explanations:

#1. ServiceDiscoveryManager starts its broadcast in a different thread, returns immideately and returns ... - you guessed it - no matches. That's why you have to wait till something may be found and query explicitly. I believe this is different in JINI 1.2.1

#2. You need to have at least jini-core and jini-ext in your codebase. sun-util may also be needed (as you have found out; we needed it for DestroyAdmin). JINI is not completely net.jini yet... We have also set up a jini-dl.jar which contains:
net/jini/core/event/RemoteEvent.class
net/jini/core/event/RemoteEvent Listener.class
net/jini/core/event/UnknownEventException.class
net/jini/lookup/S erviceDiscoveryManager$LookupCacheImpl$LookupListener_Stub.class

#3. Can't say what this is. Maybe IPv6?

#4. Can't say what this is. Ever tried jsbrowser to see if it's really available and what groups it belongs to?

Hope I could shed some light,

Micks

Flat View: This topic has 3 replies on 1 page
Topic: Javaspace image rendering Previous Topic   Next Topic Topic: distributed image processing/3d rendering

Sponsored Links



Google
  Web Artima.com   

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