java dbus bindings and network manager issues

Matthew Johnson dbus at
Fri Mar 13 16:42:27 PDT 2009

On Fri Mar 13 16:34, Greg DeAngelis wrote:
> Matt--
> I have attached two NetworkManager stubs, and
> shows the issues
> I'm experiencing. Marshalling.patch is the hack I made to at least
> allow me to retrieve paths that don't exist/exist on a different
> interface. I explain my need for this below.

OK, so, you have a lot of places you are passing around a
DBusInterface. This will cause it to be auto-proxied. Try using a Path
type instead. However, I couldn't get your test running. Your test does:

DBus.Properties props =
      DBus.Properties.class); List<Path> activeConns =
props.Get("org.freedesktop.NetworkManager", "ActiveConnections");

but that object  (at least on my version of network manager) doesn't support

$ sudo dbus-send --system --type=method_call --dest=org.freedesktop.NetworkManager --print-reply /org/freedesktop/NetworkManager org.freedesktop.DBus.Properties.Get string:foo string:bar
Error org.freedesktop.DBus.Error.UnknownMethod: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist.

To answer your specific questions:

> I had trouble finding an example of how to define a stub with
> properties and the CreateInterface tool ignores properties so I was
> just requesting a remote DBus.Properties object on a path and
> interface. 

Yes, this is correct, the bindings don't treat it specially at all.

>I hope that right but either way, the ActiveConnections
> function in shows my problem retrieving a list
> of path objects. Unlike the path issues below, these paths do exist
> and are exposed on the same interface so its really an ObjectPath/Path
> issue. It could be something I messed up but I'm not sure. Any
> suggestions?

Are you having the problem I described above? Is that the right path?

> Is there a way to disable automatic proxy creation that I'm missing?

Declaring the return / parameter type as DBusInterface will do the
path/proxy auto conversion. Using (I think) Path instead won't. At least
that's the idea. I can't test it out on your code though because of the
above properties problem.

dbus-java/org/freedesktop/dbus/test/ and 603
would be the bits of my internal test suite which test this.


D-Bus Java
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : 

More information about the dbus mailing list