-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Failed to construct outgoing method call: Primative array being sent as non-primative array. #8
Comments
Hmm... I'm not sure wether it is a race condition or some other kind of bug. Most of the code is still like it was ten years ago. I just added some generics. Line 683 in Message.java is a type cast from List to Object[], it is in deed an array of Object, so a cast to a primitive array is not possible. I wonder why it is getting to that line. When you use a byte[], data should not be a List instance. To get the root cause from all of this, can you please post the complete stacktrace? |
I mean it might be some kind of race/multithreading problem in my own code. Line 683 in my Message.java (from release 2.7.4 not the git version) shows the exception: I don't have much of a stacktrace. This is what I have (please note this is from release 2.7.4): |
Race condition in your code is also possible :) I've made a small test on my system using a DBus server written with dbus-java and a client also with dbus-java, sending around 100000 messages in a row as (primitive) byte array without any kind of DbusException. Also it does not make sense to me, that it fails in line 683. I can only imagine two possible causes:
|
Are we looking at the same code? My Message.java line 683 says This is from dbus-java-2.7.4.jar |
Sorry I looked in a newer version. Anyways... I can't help here. You should try to debug this part, so you get an idea which type is used here (check what ArgumentType sigb[i] contains). |
I'm happy to see the original dbus-java library being continued in this library and seeing active development on it. Can you give me your thoughts on the following:
I sometimes get an exception like this one, when doing a method call from Java to a C application:
"org.freedesktop.dbus.exceptions.DBusExecutionException: Failed to construct outgoing method call: Primative array being sent as non-primative array."
The method I invoke, looks like this: "int frameTransmit(byte[] frame);"
I'm a bit puzzled because this only happens ocassionally, not consistently. I'm starting to suspect some kind of multi-threading issues perhaps.
The exception message appears to originate in Message.java#683. As I understand this happens before invoking the remote method, when the signature of an array argument to the method to be called is checked. Apparently it cannot find a specifier for a primitive type in this signature.
Could this indeed be some kind of multi-threading race condition?
In a future version, can you perhaps update the exception message to include the offending type specifier in the signature? Also perhaps update the spelling of the word primitive?
The text was updated successfully, but these errors were encountered: