java dbus bindings and network manager issues

Greg DeAngelis gdeangel at gmail.com
Wed Mar 18 10:49:25 PDT 2009


Matt --

On Fri, Mar 13, 2009 at 7:42 PM, Matthew Johnson <dbus at matthew.ath.cx> wrote:
> 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:

Previously I was using a Path object, I only changed to
passing/returning a DBusInterface object to eliminate any disparity
between the stubs I created and the output of the CreateInterface tool
in case you decided to check my stubs. Either way the issue remained
but good to know the difference between the two. Interestingly enough,
a function with a return type of List<Path> (ie. GetDevices() on
org.freedesktop.NetworkManager) works just fine. I have only
encountered this issue when retrieving a dbus property with the type
List<Path>. Its also worth noting that these paths do exist and are
exposed on the same interface as the property I am retrieving.

> DBus.Properties props =
> this.conn.getRemoteObject("org.freedesktop.NetworkManager",
>      "/org/freedesktop/NetworkManager",
>      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
> properties:
>
> $ 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.

You are probably running a 6.X version of Network Manager, to my
knowledge most distros are. I have only encountered 7.X (what I am
using) in the latest ubuntu install. Its my understanding that there
was minimal dbus support pre-7.0 and what existed in 6.X has totally
changed.

>>I hope that right but either way, the ActiveConnections
>> function in NMJavaDBusIssues.java 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.

Looking at the code I removed in my hack fix, there is a code path for
introspection of ObjectPath objects which I suspect was being executed
(at least for me) because of the Path.class.equals((Class) type)
clause in the if statement on line 427 in your Marshalling class since
ObjectPath and Path are different objects.

I will look more into this tonight or tomorrow and try to collect some
debug logs for you.


Greg


More information about the dbus mailing list