[omniORB] omnievents between 2 separate machines

Paul McMahon pwm_spam at onetel.com
Fri Feb 2 09:52:02 GMT 2007


Hi Alex,

Thanks for your help.

The problem turned out to be on the java side. I found that I had to 
explicitly code the reference of the eventchannel to the following to get it 
to narrow the eventchannel successfully.

 obj=orb.string_to_object("corbaname::serveripaddress:2809#EventChannel");      

My attempts at getting this reference from the naming service failed from 
java, something to do with setting up equivalent of InitRef (omniORB.cfg) on 
java side. I tried -ORB parameters but these didn't work. Of course java has 
it's own way of setting this up which I couldn't find any good documentation 
for. If anyone has any good tips let the list know.

Anyway the hard coded name is good enough for the time being as this is only 
required temporarily for some test purposes.

On Thursday 01 February 2007 14:03, Alex Tingle wrote:
> Hi Paul,
>
> On 1 Feb 2007, at 09:36, Paul McMahon wrote:
> > When using omnievents between 2 machines, does the client need to have
> > omnievents daemon running?
>
> You only need one omniEvents daemon running,
>
> > Or is it sufficient for client to just link with a local copy of
> > omnievents
> > library and use the naming service on the server to obtain the
> > EventChannel
> > and then receive events?
>
> You are best off using libCOS that comes with omniorb, rather than the
> client library that comes with omniEvents. That way you don;t need to
> install anything special on the client machine.
>
> > So far I have got the following working:
> >
> > server
> > ------------
> > omnievents running on server
> > eventchannelfactory and eventchannel created (and appear in nameclt
> > list)
>
> How do they appear in nameclt list? Do you see
>
> EventChannel
> (id=EventChannel)
>
> or
>
> EventChannel.EventChannel
> (id=EventChannel, kind=EventChannel)
>
> > pushes events correctly according
> > to /var/lib/omniEvents/omnievents-hostname.log
>
> What are you using to push events? If it can find the channel, then the
> consumer ought to be able to find it too.
>
> > client
> > ----------
> > uses PushConn.java example supplied with omnievents.
> > obtains namingservice correctly from server
> > BUT search for eventchannel always returns "Failed to find
> > EventChannel in
> > NameService. NamingContext::NotFound"
> >
> > 			//
> > 			// Obtain object reference to EventChannel
> > 			// (from command-line argument or from the Naming Service).
> > 			if (g.getOptind() < args.length) {
> > 				action = "convert URI from command line into object reference";
> > 				obj = orb.string_to_object(args[g.getOptind()]);
> > 			} else {
> > 				action = "resolve initial reference 'NameService'";
> > 				obj = orb.resolve_initial_references("NameService");
> > 				NamingContext rootContext = NamingContextHelper.narrow(obj);
> > 				if (rootContext == null)
> > 					throw new OBJECT_NOT_EXIST();
> >
> > 				NameComponent name[] = { new NameComponent(channelName,
> > 						channelKind) };
> >
> > 				action = "find EventChannel in NameService";
> > 				System.out.println(action);
> >
> > Following line throws NotFound Exception--->
> > 				obj = rootContext.resolve(name);
> > 			}
> >
> > (channelName and channelKind are set to "EventChannel" which matches
> > what's on
> > the server).
>
> Are you sure that the id and kind match? By default kind is set to "".
>
> Are you sure that your client machine is talking to the same naming
> service as the server? What does 'nameclt list' say when you run it on
> the client?
>
> You realise that Java has to be told where to find the naming service
> in its own ideosyncratic way?
>
> -Alex
>
> --
>
> :: Let me solve your problems: http://www.firetree.net/consulting/
> :: alex.tingle AT firetree.net  +44-7901-552763



More information about the omniORB-list mailing list