Comments (5)
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?
Sample code would also be great, but the stacktrace will also help a lot.
from dbus-java.
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:
throw new MarshallingException(t("Primative array being sent as non-primative array."));
I don't have much of a stacktrace. This is what I have (please note this is from release 2.7.4):
org.freedesktop.dbus.exceptions.DBusExecutionException: Failed to construct outgoing method call: Primative array being sent as non-primative array.
at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(RemoteInvocationHandler.java:134)
at org.freedesktop.dbus.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:234)
at com.sun.proxy.$Proxy13.frameTransmit(Unknown Source)
at nl.technolution.flowmeter.dbus.DbusGdcModule.sendFrame(DbusGdcModule.java:56)
from dbus-java.
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.
For the code it looks like your data object given to the method is of type List.
I can only imagine two possible causes:
- "data" reference is changed to List by another thread while Message.class is already processing the data (missing synchonize?)
- you use libraries like fastutil or trove which provide primitive maps and lists which are compatible with List interface but return byte[] if you call 'toArray' (this cannot be casted to Object[])
from dbus-java.
Are we looking at the same code?
My Message.java line 683 says
throw new MarshallingException(t("Primative array being sent as non-primative array."));
This is from dbus-java-2.7.4.jar
from dbus-java.
Sorry I looked in a newer version.
Anyways...
the given data object seems to be an array of a primitive type, but not of any type handled in the switch statement.
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).
from dbus-java.
Related Issues (20)
- dbus-java's Maven site is difficult to discover
- Emit meaningful error message instead of IndexOutOfBoundsException when demarshalling FileDescriptor without prerequisites satisfied HOT 5
- DBusSignal constructor is package private HOT 1
- Kotlin Interface does not work HOT 3
- NPE in org.freedesktop.dbus.connections.AbstractConnection.internalDisconnect(IOException) prevents JVM shutdown HOT 4
- Documentation example does not work correctly. HOT 1
- In version 5, `withAutoConnect(false)` appears broken. HOT 2
- Cleanup AbstractConnection
- `default` interface methods. Or not. HOT 7
- problem to execute DBusViewer HOT 3
- How to export/publish Property in interface? HOT 2
- Properties Get method endless waiting HOT 1
- Cannot connect to DBUS HOT 11
- Sending signal with byte[] fails with verbose logging HOT 1
- [Feature request] Any plan in adding a module-info ? HOT 2
- Custom ITransportProvider cannot be found by ServiceLoader HOT 4
- Something a bit wrong with `@DBusBoundProperty` HOT 9
- Incorrect code generation for systemd StartTransientUnit HOT 3
- Add dbus-java-transport-junixsocket to dbus-java-bom
- Help with DBusConnectionBuilder HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbus-java.