hypfvieh / dbus-java

Improved version of java DBus library provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/)
https://hypfvieh.github.io/dbus-java/
MIT License
185 stars 73 forks source link

Could not find suitable constructor ... #160

Closed brett-smith closed 2 years ago

brett-smith commented 2 years ago

I'm seeing this log message come from dbus-java in one of my applications using the embedded daemon with the master branch . So this appears to only be server side, it's fine when I use my application with a native dbus broker.

14-02-2022 12:04:27 [DBus-Signal-Receiver-1] WARN  DBusSignal - Could not find suitable constructor for class org.freedesktop.dbus.interfaces.DBus$NameAcquired with argument-types: []

I don't think I am using the NameAcquired event anywhere, but is this anything to worry about?

hypfvieh commented 2 years ago

Thanks for the report. This is a bug related to changes I made recently.

The NameAcquired (and NameOwnerChanged) signal should always be emitted when a new client connected to the Bus and send 'Hello' message.

The bug is, that the signal which should be send needs another type of constructor than NameAcquired provides. In the previous code the signal was created using new DBusSignal(...) instead of using NameAcquired. As far as I can see the usage of NameAcquired like introduced in the latest changes do not work because the signal is created differently than before. Therefore using NameAcquired implementation only works for receiving the signal, not sending.

I reverted my changes causing the bug. I also fixed some issues in test setup (jnr-unixsocket transport was tested twice, native-transport was never used). I also bumped the version to 4.1.0.

brett-smith commented 2 years ago

That's fixed it, thanks.

Regarding the test setup changes, I think I encountered the results of this when building 4.1.0-SNAPSHOT with Maven. The -tests module failed to build unless built with JDK16. That's totally fine of course, makes sense.

hypfvieh commented 2 years ago

I updated the pom to address this inconvenience. Now tests are only ran if JDK 16 or higher is used to compile and test the source. If something below JDK 16 is used, only jnr and tcp will be build and tested

hypfvieh commented 2 years ago

I guess this one is done, I'll close this ticket.