Problem in calling a method of one java application from another java application using DBus.

Matthew Johnson dbus at matthew.ath.cx
Sun Mar 21 11:39:42 PDT 2010


On Thu Mar 04 04:38, Shiv Nath Kumar wrote:
> interface TestDBusInt extends DBusInterface{
> public void myfun();
> }
 
...

>         // Getting and Displaying Introspection data on Remote Object.
>        * Introspectable intro = (Introspectable) bus1.getRemoteObject(
>                               "My.FirstBus", "/Test",
>                                Introspectable.class);

...

> 
>         //Getting the remote object and calling a method of that object.
>   *DBusInterface db =bus1.getPeerRemoteObject("**My.FirstBus","/Test");
>         DBusAsyncReply<Boolean> stuffreply =bus1.callMethodAsync(db,"**
> myfun");*

Two things here: 

first, are you using Async for a particular reason, you can do this exactly as
you have in Introspectable above:

   Demo demo = (Demo) bus1.getPeerRemoteObject("My.FirstBus", "/Test");

or:

   Demo demo = bus1.getPeerRemoteObject("My.FirstBus", "/Test", Demo.class);

then you can do:

   demo.myfun();

Second thing, myfun returns void but you have DBusAsyncReply<Boolean>. Not sure
if that's causing the exception.

Matt

-- 
www.matthew.ath.cx
D-Bus Java
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100321/5c6c2ab3/attachment.pgp>


More information about the dbus mailing list