qtjambi icon indicating copy to clipboard operation
qtjambi copied to clipboard

Could not load the Qt platform plugin "wayland" in "" even though it was found.

Open MarkLTZ opened this issue 3 years ago • 8 comments

Hello there!

I have the issue in the object using bundled qt 6.4.0:

# java -cp lib/*:. it.sample.wizard.Main

qt.core.plugin.factoryloader: Got keys from plugin meta data QList("wayland-egl")
qt.core.plugin.factoryloader: checking directory path "/usr/lib/jvm/java-11-openjdk-11.0.16.1.1-1.fc36.x86_64/bin/platforms" ...
qt.core.library: "/tmp/QtJambi6.4.0_s0n1k_567645/plugins/platforms/libqwayland-generic.so" cannot load: Cannot load library /tmp/QtJambi6.4.0_s0n1k_567645/plugins/platforms/libqwayland-generic.so: (libQt6WaylandClient.so.6: cannot open shared object file: No such file or directory)
qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/tmp/QtJambi6.4.0_s0n1k_567645/plugins/platforms/libqwayland-generic.so" : "Cannot load library /tmp/QtJambi6.4.0_s0n1k_567645/plugins/platforms/libqwayland-generic.so: (libQt6WaylandClient.so.6: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

This is a list of deployed jar files:

# ls -la lib/qt*
-rw-r--r--. 1 s0n1k s0n1k  3781466 Sep 30 17:13 lib/qtjambi-6.4.0.jar
-rw-r--r--. 1 s0n1k s0n1k 24388645 Sep 30 17:14 lib/qtjambi-native-linux-x64-6.4.0.jar
-rw-r--r--. 1 s0n1k s0n1k  2979513 Sep 30 17:13 lib/qt-lib-core-native-linux-x64-6.4.0.jar
-rw-r--r--. 1 s0n1k s0n1k   343998 Sep 30 17:13 lib/qt-lib-dbus-native-linux-x64-6.4.0.jar
-rw-r--r--. 1 s0n1k s0n1k  5130928 Sep 30 17:13 lib/qt-lib-gui-native-linux-x64-6.4.0.jar
-rw-r--r--. 1 s0n1k s0n1k   201365 Sep 30 17:13 lib/qt-lib-svg-native-linux-x64-6.4.0.jar
-rw-r--r--. 1 s0n1k s0n1k   507131 Sep 30 17:14 lib/qt-lib-waylandclient-native-linux-x64-6.4.0.jar
-rw-r--r--. 1 s0n1k s0n1k  3557872 Sep 30 17:13 lib/qt-lib-widgets-native-linux-x64-6.4.0.jar

Looking inside QT bundled jar files I found:

# jar tvf lib/qt-lib-waylandclient-native-linux-x64-6.4.0.jar | grep libQt6WaylandClient.so
1276488 Fri Sep 30 17:08:56 CEST 2022 lib/libQt6WaylandClient.so.6.4.0

But it seams it's not auto deployed under /tmp/QtJambi6.4.0_s0n1k_567645:

# ldd /tmp/QtJambi6.4.0_s0n1k_567645/plugins/platforms/libqwayland-generic.so | grep "not found"
	libQt6WaylandClient.so.6 => not found

# ls -la /tmp/QtJambi6.4.0_s0n1k_567645/lib/libQt6WaylandClient*
ls: cannot access '/tmp/QtJambi6.4.0_s0n1k_567645/lib/libQt6WaylandClient*': No such file or directory

Could you please help me?

Thanks, Marco

MarkLTZ avatar Sep 30 '22 15:09 MarkLTZ

Oh, that's something missing in QtJambi. thanks for reporting. Fix it by adding the following line at the beginning of main():

io.qt.QtUtilities.loadQtLibrary("WaylandClient", io.qt.QtUtilities.LibraryRequirementMode.ProvideOnly, "linux");

omix avatar Sep 30 '22 16:09 omix

it works, but now I have this error:

qt.core.plugin.factoryloader: Got keys from plugin meta data QList()
qt.core.plugin.factoryloader: checking directory path "/usr/lib/jvm/java-11-openjdk-11.0.16.1.1-1.fc36.x86_64/bin/wayland-graphics-integration-client" ...
qt.core.library: "/tmp/QtJambi6.4.0_s0n1k_592474/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so" cannot load: Cannot load library /tmp/QtJambi6.4.0_s0n1k_592474/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so: (libQt6WaylandEglClientHwIntegration.so.6: cannot open shared object file: No such file or directory)
qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/tmp/QtJambi6.4.0_s0n1k_592474/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so" : "Cannot load library /tmp/QtJambi6.4.0_s0n1k_592474/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so: (libQt6WaylandEglClientHwIntegration.so.6: cannot open shared object file: No such file or directory)"
qt.qpa.wayland: Failed to load client buffer integration: "wayland-egl"
qt.qpa.wayland: Available client buffer integrations: QList("wayland-egl")

MarkLTZ avatar Sep 30 '22 19:09 MarkLTZ

Isn't there Qt6WaylandEglClientHwIntegration in the bundle?

Otherwise add:

io.qt.QtUtilities.loadQtLibrary("WaylandEglClientHwIntegration", io.qt.QtUtilities.LibraryRequirementMode.ProvideOnly, "linux");

omix avatar Sep 30 '22 19:09 omix

Oh, as I see, you are using QtJambi for Qt 6.4.0. Did you build it yourself from latest release?

omix avatar Sep 30 '22 19:09 omix

Oh, as I see, you are using QtJambi for Qt 6.4.0. Did you build it yourself from latest release?

Yes I did.

MarkLTZ avatar Sep 30 '22 20:09 MarkLTZ

Still one issue looking for libQt6OpenGL.so.6:

qt.core.plugin.factoryloader: Got keys from plugin meta data QList()
qt.core.plugin.factoryloader: checking directory path "/usr/lib/jvm/java-11-openjdk-11.0.16.1.1-1.fc36.x86_64/bin/wayland-graphics-integration-client" ...
qt.core.library: "/tmp/QtJambi6.4.0_s0n1k_593796/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so" cannot load: Cannot load library /tmp/QtJambi6.4.0_s0n1k_593796/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so: (libQt6OpenGL.so.6: cannot open shared object file: No such file or directory)
qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/tmp/QtJambi6.4.0_s0n1k_593796/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so" : "Cannot load library /tmp/QtJambi6.4.0_s0n1k_593796/plugins/wayland-graphics-integration-client/libqt-plugin-wayland-egl.so: (libQt6OpenGL.so.6: cannot open shared object file: No such file or directory)"
qt.qpa.wayland: Failed to load client buffer integration: "wayland-egl"
qt.qpa.wayland: Available client buffer integrations: QList("wayland-egl")

MarkLTZ avatar Sep 30 '22 20:09 MarkLTZ

Ok, the solution for this kind of error should now be streight forward. I will take this thread to improve the deployment dependencies. So if you have firther missing things, post it.

omix avatar Sep 30 '22 20:09 omix

Ok, the solution for this kind of error should now be streight forward. I will take this thread to improve the deployment dependencies. So if you have firther missing things, post it.

I used this as workaround:

io.qt.QtUtilities.loadQtLibrary("OpenGL", io.qt.QtUtilities.LibraryRequirementMode.ProvideOnly, "linux");

Now, no more errors occurs and my app start properly.

I hope a fix will be available soon so I can remove these workarounds.

Thanks for you fast and excellent support.

Marco

MarkLTZ avatar Sep 30 '22 21:09 MarkLTZ