尝试在 webdriver.io 项目中打开 allure-reports 时出现异常 java.lang.UnsatisfiedLinkError [英] Exception java.lang.UnsatisfiedLinkError when trying to open allure-reports in webdriver.io project

查看:29
本文介绍了尝试在 webdriver.io 项目中打开 allure-reports 时出现异常 java.lang.UnsatisfiedLinkError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小的 webdriver.io 项目,只是为了第一次试验它.我现在想添加诱惑报告,但是当我尝试运行 allure open 时出现以下异常,我不知道我必须在哪里解决这个问题:

I have a small webdriver.io project just for experimenting with it for the first time. I now wanted to add allure reports but when I try to run allure open I get the following exception and I have no idea where I have to look to resolve this:

Starting web server...
2021-05-04 22:06:43.669:INFO::main: Logging initialized @349ms to org.eclipse.jetty.util.log.StdErrLog
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
        at java.base/java.lang.Runtime.load0(Runtime.java:768)
        at java.base/java.lang.System.load(System.java:1837)
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
        at java.base/java.lang.System.loadLibrary(System.java:1873)
        at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1399)
        at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1397)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1396)
        at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1429)
        at java.desktop/java.awt.Desktop.isDesktopSupported(Desktop.java:328)
        at io.qameta.allure.Commands.openBrowser(Commands.java:220)
        at io.qameta.allure.Commands.open(Commands.java:152)
        at io.qameta.allure.CommandLine.run(CommandLine.java:165)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)

报告生成得很好.只有当我尝试打开它们时,才会出现此错误.

The reports are getting generated just fine. Only when I try to open them I get this error.

我通过 npm 安装了 allure-reporter 和 allure-commandline.我的项目位于 Debian WSL 中,并使用 VcXsrv X Server 运行 chromedriver,以防万一这可能会有所帮助.

I have allure-reporter and allure-commandline installed via npm. I have my project inside a Debian WSL and run chromedriver with VcXsrv X Server in case this might help.

有没有人知道如何解决这个错误,或者有关于寻找什么的提示?我希望我给了你足够的信息.如果没有,就说你需要什么.预先感谢您的帮助!

Does anybody have an idea how this error might get resolved or have a hint for what to look for? I hope I gave you enough information. If not, just say what you need. Thanks in advance for your help!

我再次安装了 openjdk-11-jdk 并解决了原来的错误.但现在我收到以下消息:

I installed openjdk-11-jdk again and that resolved the original error. But now I'm getting the following message:

2021-05-04 23:33:34.871:INFO::main: Logging initialized @395ms to org.eclipse.jetty.util.log.StdErrLog
Browse operation is not supported on your platform.You can use the link below to open the report manually.
java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!
        at java.desktop/java.awt.Desktop.checkActionSupport(Desktop.java:380)
        at java.desktop/java.awt.Desktop.browse(Desktop.java:524)
        at io.qameta.allure.Commands.openBrowser(Commands.java:222)
        at io.qameta.allure.Commands.open(Commands.java:152)
        at io.qameta.allure.CommandLine.run(CommandLine.java:165)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
Server started at <http://127.0.1.1:46223/>. Press <Ctrl+C> to exit

当我点击那个链接时,它无法访问.

And when I follow that link its not reachable.

推荐答案

在 ubuntu 20.04 上:

on ubuntu 20.04:

sudo apt install openjdk-11-jdk

正如 Joakim 建议的 在此评论中,安装了无头版本.我在使用 ldd 时遇到了同样的错误,缺少库.

As Joakim suggested in this comment here, the headless version was installed. I got the same error with ldd, the library missing.

总体上改变您的问题不是一个好主意,最好先搜索并在需要时询问一个新问题,并提供所有细节.

It's not a good idea to change your question in general, it's better to search first and ask a new one if needed, with all specifics.

这可能有助于您了解第二个问题的可能原因:

This may help you understand the possible cause of the second issue:

当前平台不支持桌面 API

如果您想使用 Linux,我强烈建议您使用普通的 Ubuntu Linux 安装,WSL 不一样,并且具有您在 Linux 中不会遇到的特定问题.如果无法选择专用安装,请尝试查找一般问题.预计 shell、docker 和图形相关事物的行为会有所不同,因为这些事物是以特定方式为 WSL 专门实现的.

I highly recommend to use a plain Ubuntu Linux installation if you want to use Linux, WSL is not the same and has specific issues that you will not encounter in Linux. If a dedicated install is not an option, try to look for generic issues. Expect differences in behavior with shells, docker and graphical related things, because those things are specifically implemented in certain ways for WSL.

这篇关于尝试在 webdriver.io 项目中打开 allure-reports 时出现异常 java.lang.UnsatisfiedLinkError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆