java dbus bindings and network manager issues

Matthew Johnson dbus at matthew.ath.cx
Wed Mar 11 18:02:38 PDT 2009


On Wed Mar 11 12:19, Greg DeAngelis wrote:
> When trying to retrieve a list of Paths from some dbus Properties
> objects, such as the ActiveConnections property on line 33, I get a
> list of ObjectPath objects. ObjectPath is package protected in the
> library and thus not accessible. This class is also not cast-able to
> the Path object. Temporarily I have been retrieving a list of Objects
> and call toString() to get the path string but there is clearly a
> return value parsing issue.

First of all, can you send me the network manage stubs you are using,
that will affect how things are processed.

ObjectPath/Path return values have always been a bit of a hack. If you change
the Java interface definition to just String (which is all they really
are) and manually construct the proxies I _think_ that should just work.

> Network Manager uses a path of / to indicate a null value since dbus
> lacks this type. This occurs in a few places in their dbus
> architecture most notably when an interface does not have an active
> dhcp configuration, when a connection does not point to a specific
> object (wifi connections point to the accesspoint objects, wired
> connections will have a /), and when a wifi interface is not
> associated with an accesspoint. It appears that the java bindings do
> not like this. I suspect this is another introspection failure because
> the path does not exist.

Yes, if you try and autocreate proxies for paths which do not exist it
will behave badly. Don't do this!

> The only solution I have found thus far for the last two issues is to
> remove the call to getExportedObject on line 430 of Marshalling.java
> and just always construct the Path object. While I have yet to
> encounter an issue in doing so, I'm hesitant towards calling this a
> good solution. Perhaps the author can chime in here? Also note, the
> first issue exists regardless of whether I make this change or not.
> Thanks for your time and I apologize for the lengthy post.

No problems, like I say, I could do with seeing the stubs you are using
and I think changing them should fix the problem. I don't think you can
ever have it work with instantiating proxies given how NM sends
nonexistent object paths back. 

Even better would be some code you can send me so I can repro any
failures.

Matt

-- 
www.matthew.ath.cx
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 : http://lists.freedesktop.org/archives/dbus/attachments/20090312/6255dfea/attachment.pgp 


More information about the dbus mailing list