JDK-8214579 : JFrame does not paint content in XVFB / X11vnc environment
  • Type: Bug
  • Component: client-libs
  • Affected Version: 11,12,13
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2018-11-30
  • Updated: 2021-11-19
  • Resolved: 2019-05-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14
11.0.5-oracleFixed 13 b24Fixed 14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Ubuntu Server with openssh, xvfb, x11vnc, Eclipse 2018-12, Java Version 11.0.1

A DESCRIPTION OF THE PROBLEM :
JFrames have no content in an XVFB / x11vnc environment with java 11. They open up and can be moved around, but they do not paint the content. The sample provided worked with a java 8 environment.

REGRESSION : Last worked in version 8u181

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
 * Set up VM with above config, or use the container from: https://hub.docker.com/r/inetsoftware/ubuntu-x11-eclipse/
 * Create a new Java Project with provided source code
 * Download 11.0.1 JDK and set up as run configuration
 * Run the Example


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A Frame with the Text "tada" should open
ACTUAL -
An empty frame opens

---------- BEGIN SOURCE ----------
import javax.swing.JFrame;
import javax.swing.JLabel;

public class FrameCheck {

	public static void main(String[] args) {
		JFrame frame = new JFrame("FrameCheck");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(400, 300);
		frame.getContentPane().add(new JLabel("tada"));
		frame.setVisible(true);
	}

}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
There is no workaround. Running the code with java 8 works as expected

FREQUENCY : always



Comments
Fix request (11u): Request to backport this fix to keep in sync with Oracle 11.0.5. Patch applies cleanly and will be tested @SAP before pushing.
24-06-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/c53905e7dc57 User: psadhukhan Date: 2019-06-04 08:52:03 +0000
04-06-2019

URL: http://hg.openjdk.java.net/jdk/client/rev/c53905e7dc57 User: dmarkov Date: 2019-05-20 14:43:32 +0000
20-05-2019

As it was mentioned above the problem was triggered by JDK-8204931 After integration of JDK-8204931 SurfaceType with PixelConverter is used when createData() is called for XRWindowSurfaceData. Unfortunately it does not work properly for some cases like this one, (i.e. a frame does not have any content if XVFB/X11VNC environment is used). Possible fix: Explicitly use X11SurfaceType instead of XRSurfaceType inside createData() for XRWindowSurfaceData.
02-01-2019

Changing Type from Enhancement to Bug as it is a regression and increasing the priority.
24-12-2018

I reproduced this issue on docker environment. Attached the screenshots for working(working.png) and non-working(non_working.png) conditions. Test results with different JDK versions and builds: JDK 8u191 - PASSED JDK 10 GA - PASSED JDK 11 build 24 - PASSED JDK 11 build 25 - FAILED JDK 11 GA - FAILED JDK 11.0.1 GA - FAILED JDK 11.0.2 build 7(latest build as of now) - FAILED JDK 12 build 5 - PASSED JDK 12 build 6 - FAILED JDK 12 build 25(latest build as of now) - FAILED So it is a regression from JDK 11 build 25 (or JDK 12 build 6) onwards. After reviewing fixes went in these builds, I strongly believe this is a regression introduced by task JDK-8204931.
24-12-2018

Response from submitter: Please find attached a zip file with the Dockerfile instructions as well as some required files. Once build, the container runs a VNC server on port 5900 which has to be mapped. You can connect a VNC client to it and do the tests in the bash command line. There is a compiled java File ¿GuiTest¿ which you can directly execute using ¿java GuiTest¿ in the /root folder. You should now see a panel with the test text in the VNC client. Using wget you can download another Java Runtime, unpack it and execute the GuiTest class again. The panel does appear, but it will stay empty (I checked using the latest JDK 12 EA from 2018/12/6).
24-12-2018

ubuntu server is not supported platform for jdk12 , also there's no confirmation that it's not seen before jdk11 plus there's involvement of docker which seems to be outside client-libs scope so retargetting to jdk13.
10-12-2018

Reported as a regression in JDK 11, JFrame does not paint content in XVFB / X11vnc environment in Ubuntu. Attached test case, works fine with JDK 8u191 and 11.0.1 when tested in Ubuntu 18.10, though still need to be checked in environment for XVFB / X11vnc environment. Actual steps to reproduce: - Set up VM with above config, or use the container from: https://hub.docker.com/r/inetsoftware/ubuntu-x11-eclipse/ - Create a new Java Project with provided source code - Download 11.0.1 JDK and set up as run configuration - Run the Example
01-12-2018