I have a signal defined, that contains a field with type byte[].
class Signal extends DBusSignal {
private final byte[] groupId;
public Signal(
String objectpath,
byte[] groupId
) throws DBusException {
super(objectpath, groupId);
this.groupId = groupId;
}
}
Sending this connection.sendMessage(new Signal(...)) works fine, with normal log level.
But when I set the log level to verbose, the sending fails.
The error seems to be in the code in LoggingHelper that tries to to serialize the the object to a string.
It fails to cast a byte array (byte[], [B) to an object array (Object[], [Ljava.lang.Object;), which doesn't work. Primitive arrays can't be cast to an object array.
Error:
java.lang.ClassCastException: class [B cannot be cast to class [Ljava.lang.Object; ([B and [Ljava.lang.Object; are in module java.base of loader 'bootstrap')
at org.freedesktop.dbus.utils.LoggingHelper.arraysVeryDeepStringRecursive(LoggingHelper.java:56)
at org.freedesktop.dbus.utils.LoggingHelper.arraysVeryDeepString(LoggingHelper.java:34)
at org.freedesktop.dbus.messages.Message.lambda$append$3(Message.java:882)
at org.freedesktop.dbus.utils.LoggingHelper.logIf(LoggingHelper.java:76)
at org.freedesktop.dbus.messages.Message.append(Message.java:882)
at org.freedesktop.dbus.messages.DBusSignal.appendbody(DBusSignal.java:277)
at org.freedesktop.dbus.connections.AbstractConnection.sendMessageInternally(AbstractConnection.java:1087)
at org.freedesktop.dbus.connections.AbstractConnection$1.run(AbstractConnection.java:406)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
I have a signal defined, that contains a field with type
byte[]
.Sending this
connection.sendMessage(new Signal(...))
works fine, with normal log level. But when I set the log level to verbose, the sending fails.The error seems to be in the code in
LoggingHelper
that tries to to serialize the the object to a string. It fails to cast a byte array (byte[]
,[B
) to an object array (Object[]
,[Ljava.lang.Object;
), which doesn't work. Primitive arrays can't be cast to an object array.Error:
Version: 4.3.1