Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MarkLTZ opened this issue Sep 30, 2022 · 8 comments

Comments

@MarkLTZ
Copy link

MarkLTZ commented Sep 30, 2022

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

@omix
Copy link
Contributor

omix commented Sep 30, 2022

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");

@MarkLTZ
Copy link
Author

MarkLTZ commented Sep 30, 2022

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")

@omix
Copy link
Contributor

omix commented Sep 30, 2022

Isn't there Qt6WaylandEglClientHwIntegration in the bundle?

Otherwise add:

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

@omix
Copy link
Contributor

omix commented Sep 30, 2022

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

@MarkLTZ
Copy link
Author

MarkLTZ commented Sep 30, 2022

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
Copy link
Author

MarkLTZ commented Sep 30, 2022

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")

@omix
Copy link
Contributor

omix commented Sep 30, 2022

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.

@MarkLTZ
Copy link
Author

MarkLTZ commented Sep 30, 2022

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

omix added a commit that referenced this issue Oct 15, 2022
Bugfix Issue #89
Bugfix Issue #86
Bugfix Issue #85
Bugfix Issue #84
Bugfix Issue #83
Bugfix Issue #79
Bugfix Issue #78
Bugfix Issue #77
Bugfix Issue #75
@omix omix closed this as completed Oct 15, 2022
omix added a commit that referenced this issue Jul 25, 2023
Bugfix Issue #89
Bugfix Issue #86
Bugfix Issue #85
Bugfix Issue #84
Bugfix Issue #83
Bugfix Issue #79
Bugfix Issue #78
Bugfix Issue #77
Bugfix Issue #75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants