[omniORB] omnievents between 2 separate machines
Alex Tingle
alex.tingle at bronermetals.com
Thu Feb 1 14:03:47 GMT 2007
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