Re: multiple services in one vm?
Rikard Elofsson <[email protected]>
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Organization | Superlocal |
| Message-ID | <[email protected]> |
Vinod Johnson wrote:
> The log indicates that one of your interfaces (eth1) is not configured
> for multicast (it does not have any IP addresses bound to it). This is
> not necessarily a problem (the log is at HANDLED level). You may
> configure both LookupDiscovery and reggie (multicastInterfaces entry) to
> use only the interfaces that you desire.
OK. I'll try to find out how, if someone knows and want to save me some
time don't hesitate to tell me ;-)
> By all hell breaks lose, are you referring to these log messages, or is
> there any other misbehavior in your application?
I mean that the log goes haywire. I'm sure this could be amended by
setting a lower log level but what vexes me is this:
My 3 things are
1) reggie
2) my server
3) my client
If I start my 3 things (reggie, my client, my server) in separate VMs
everything works fine. When I run in one single VM the first two steps
work like a treat but my client gives a lot of error messages it doesent
give when I use 3 different VMs
My client code is like this, what could be the "bad" part? Or is it how
I set up reggie or export my server service?
--------------------------------------------------------------------------
LookupCache cache = null;
// set security policy
System.setProperty("java.security.policy", "config/policy.all");
System.setSecurityManager(new RMISecurityManager());
Class[] classes = new Class[] { RemoteLog.class };
try {
LookupDiscoveryManager mgr = new
LookupDiscoveryManager(LookupDiscovery.ALL_GROUPS, null, null);
ServiceDiscoveryManager clientMgr = new ServiceDiscoveryManager(mgr,
new LeaseRenewalManager());
ServiceTemplate template = new ServiceTemplate(null, classes, null);
cache = clientMgr.createLookupCache(template, null, null);
} catch (Exception e) {
e.printStackTrace();
return;
}
// loop until service found
ServiceItem item = null;
while (item == null) {
System.out.println("searching for service");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
// see if a service is there now
item = cache.lookup(null);
}
remoteLog = (RemoteLog) item.service;
--------------------------------------------------------------------------
Getting Started: http://www.jini.org/wiki/Category:Getting_Started
Community Web Site: http://jini.org
jini-users Archive: http://archives.java.sun.com/archives/jini-users.html
Unsubscribing: email "signoff JINI-USERS" to [email protected]