-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on returning list of nested objects. #163
Comments
This one is tough... As far as I've seen the problem is created when the method return is constructed.
I fixed this right now, added a test and also took you code to provide a working sample in dbus-java-examples project. |
Close, but not quite :) This works if the exported object and the client are in the same JVM. However, I found that when I applied this fix in my application (with 2 JVMs), it failed. I proved the same thing in the test application above by splitting it into two separate classes, one doing the export and one using it, and it does indeed crash.
It appears that the proxy object returned does not implement Edit: It looks like this is happening because |
Here is a patch for this. Instead of deriving the type from the introspection data, it needs to derive the type from the Java interface which is known at this time. I wasn't sure if this should always do this, or if it should only do so when the type is not found any other way. I went with always. |
Nice, I reviewed and applied you patch to master. |
That looks good. I've just found another problem though that seems to be kind of related. It seems that I have a I can see the following in the logs ..
I'll dig a bit deeper and post back. Edit: Think i've found this. The problem is By changing
.. I get a bit further. Seems there is more to do though. Edit: This does actually fix it for me. Im not 100% confident it won't break something else though. Edit: More on this. It seems that signals are not converting Edit: The fix for this was in the same place. if(DBusInterface.class.isAssignableFrom(class1) && ObjectPath.class.equals(_wantedArgs.get(i))) {
continue;
} |
Please provide a PR if you are done with your changes. |
Will do. Ive just found that my previous |
Have bundled all the above changes in #164, which I was in the middle of anyway. It all got a bit complicated, see the PR. |
Nice. I'll close this issue. |
I'm seeing a connection crash when attempting to access an exported list of objects.
I have distilled the problem from my application into a short, self contained example.
You'll see that
getPartNames()
works (a list of strings), butgetParts()
fails (a list of actual objects). As I understand it, dbus-java should turn these intoObjectPath
native types for you. This does appear to happen, as if I look in d-feet I can see the method signature correctly, but actually calling it results in the connection being terminated.It didn't seem to matter if I exported the "parts" myself, the result was the same.
Am I doing it wrong or is this a bug?
This results in ..
The text was updated successfully, but these errors were encountered: