No X11 DISPLAY variable was set, but this program performed an operation which requires it
See original GitHub issueSummary
i’m using below devfile.yaml
. i have specified is a javacontainer
and selenium novnc-container
schemaVersion: 2.1.0
metadata:
name: cbfsel-repo
projects:
- name: cbfsel-project
git:
checkoutFrom:
revision: master
remotes:
origin: https://gitlab.myorganization/repository.git
components:
- container:
image: 'quay.io/devfile/universal-developer-image:ubi8-0e189d9'
memoryLimit: 2G
endpoints:
- exposure: none
name: debug
protocol: tcp
targetPort: 5005
- exposure: public
name: 8080-http
protocol: http
targetPort: 8080
volumeMounts:
- name: m2volume
path: /home/user/.m2
name: javacontainer
- container:
image: 'mycustomdockerregistry/standalone-chrome:4.1.2-20220217'
memoryLimit: 2G
endpoints:
- exposure: public
name: 4444-tcp
protocol: tcp
targetPort: 4444
- exposure: public
name: 5900-tcp
protocol: tcp
targetPort: 5900
- exposure: public
name: 7900-http
protocol: http
targetPort: 7900
secure: true
volumeMounts:
- name: seleniumvolume
path: /home/user/.m2
name: seleniumcontainer
- name: m2volume
volume:
size: 2G
- name: seleniumvolume
volume:
size: 2G
commands:
- exec:
commandLine: mvn clean package -DskipTests
component: javacontainer
group:
isDefault: true
kind: build
label: 'build project using maven'
workingDir: '${PROJECT_SOURCE}'
id: mvnpackage
The javaprogram in the workspace will make use of the selenium-novnc container to run tests on webpages.
when i execute the javaprogram, the first page of my test appears in the selenium-novnc
website, but then it fails with below error(i understand below stacktrace shows some of my classnames, but its fine).
vTAPRegression.moduledrivers.DuckduckgoDriver@41200e0c|Error: Failed in executing component |vTap_duck_Operation| |java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at cbf.engine.BaseModuleDriver.invokeMethod(BaseModuleDriver.java:103)
at cbf.engine.BaseModuleDriver.eval(BaseModuleDriver.java:56)
at cbf.engine.BaseModuleDriver.perform(BaseModuleDriver.java:50)
at cbf.engine.BaseAppDriver.perform(BaseAppDriver.java:61)
at cbf.engine.TestCaseRunner.performComponent(TestCaseRunner.java:260)
at cbf.engine.TestCaseRunner.access$400(TestCaseRunner.java:41)
at cbf.engine.TestCaseRunner$4.run(TestCaseRunner.java:234)
at cbf.engine.TestResultTracker.track(TestResultTracker.java:135)
at cbf.engine.TestCaseRunner.runComponent(TestCaseRunner.java:229)
at cbf.engine.TestCaseRunner$3.run(TestCaseRunner.java:168)
at cbf.engine.TestResultTracker.track(TestResultTracker.java:135)
at cbf.engine.TestCaseRunner.runStep(TestCaseRunner.java:160)
at cbf.engine.TestCaseRunner$2.run(TestCaseRunner.java:139)
at cbf.engine.TestResultTracker.track(TestResultTracker.java:135)
at cbf.engine.TestCaseRunner.runIteration(TestCaseRunner.java:132)
at cbf.engine.TestCaseRunner.access$200(TestCaseRunner.java:41)
at cbf.engine.TestCaseRunner$1.run(TestCaseRunner.java:113)
at cbf.engine.TestResultTracker.track(TestResultTracker.java:135)
at cbf.engine.TestCaseRunner.runTestCase(TestCaseRunner.java:89)
at cbf.engine.Engine.runTestCase(Engine.java:48)
at cbf.engine.TestSetRunner$4.run(TestSetRunner.java:146)
at cbf.engine.TestResultTracker.track(TestResultTracker.java:135)
at cbf.engine.TestSetRunner.runTestInstance(TestSetRunner.java:130)
at cbf.engine.TestSetRunner$3.run(TestSetRunner.java:107)
at cbf.engine.TestResultTracker.track(TestResultTracker.java:135)
at cbf.engine.TestSetRunner.runTestsetRerun(TestSetRunner.java:98)
at cbf.engine.TestSetRunner$1.run(TestSetRunner.java:65)
at cbf.engine.TestResultTracker.track(TestResultTracker.java:135)
at cbf.engine.TestSetRunner.runTestSet(TestSetRunner.java:60)
at cbf.engine.Engine.runTestSet(Engine.java:42)
at cbf.engine.TestSetRunner.runTestSetInstance(TestSetRunner.java:183)
at cbf.runner.MainRunner.<init>(MainRunner.java:61)
at cbf.runner.MainRunner.main(MainRunner.java:53)
Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.desktop/sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:186)
at cbf.reporting.ScreenDumpManager.dumpScreen(ScreenDumpManager.java:154)
at cbf.reporting.ScreenDumpManager.log(ScreenDumpManager.java:122)
at cbf.engine.TestResultTracker.log(TestResultTracker.java:177)
at cbf.engine.TestResultLogger.log(TestResultLogger.java:159)
at cbf.engine.TestResultLogger.passed(TestResultLogger.java:86)
at vTAPRegression.moduledrivers.DuckduckgoDriver.vTap_duck_Operation(DuckduckgoDriver.java:42)
... 37 more
i noticed this error Caused by: java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
. i’m not sure how to fix this.
i tried adding export DISPLAY=:0
, export DISPLAY=localhost:0.0
, export DISPLAY=:0.0
, it didn’t work
below is the operating system detail of the `java container
please let me know how to fix this problem
Relevant information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
/cc @benoitf
I believe it won’t work. It works only for current terminal session.
I don’t think that it is possible to install something that requires sudo rights when workspace is up and running. I recommend to build your own image on top of universal one and install there anything your need (plus set any environment variables) .