Skip to content

java-systemd not compatible with dbus-java v5 #10

Description

@mbaudier

With the latest major release of dbus-java (v5.0.0), Systemd.get().getManager() fails with:

java.lang.NoSuchMethodError: org/freedesktop/dbus/connections/impl/DBusConnection.getConnection(Lorg/freedesktop/dbus/connections/impl/DBusConnection$DBusBusType;)Lorg/freedesktop/dbus/connections/impl/DBusConnection; (loaded from xxxxxxx/org.freeedesktop.dbus.5.0.jar by org.eclipse.osgi.internal.loader.EquinoxClassLoader@99aa01a5[org.freeedesktop.dbus:5.0.0(id=183)]) called from class de.thjom.java.systemd.Systemd (loaded from xxxxxxxxx/de.thjom.java.systemd.2.1.jar by org.eclipse.osgi.internal.loader.EquinoxClassLoader@3fb8805f[de.thjom.java.systemd:2.1.0(id=204)]).
	de.thjom.java.systemd.Systemd.open(Systemd.java:164)
	de.thjom.java.systemd.Systemd.get(Systemd.java:116)
	de.thjom.java.systemd.Systemd.get(Systemd.java:105)
	...

Apparently the DBusConnection.getConnection(DBusConnection.DBusBusType.SYSTEM) method has been removed.

I had the same issue with some low-level code which uses dbus-java directly, and it worked by using:
DBusConnection dBusConnection = DBusConnectionBuilder.forSystemBus().build() instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions