Go Back   DisplayLink Forum > DisplayLink Graphics Technology > Mac Software

Reply
 
Thread Tools Search this Thread Display Modes
Old 03-20-2019, 08:11 AM   #1
phs
Junior Member
 
Join Date: Mar 2019
Posts: 4
Default 5.1 Crashes when launching Java 8 Swing app with closed lid

I have a macBook Pro (15-inch, Late 2016) running on macOS Mojave 10.14.3 with DisplayLink Driver 5.1 for the Dell Dock D6000.

I use a single external monitor with 1920x1200 resolution via a DisplayPort Adapter.

When I connect the macBook to the dock and close the lid, then I cannot start any Java Swing based application using JDK8 or JDK11.

You can use the following code to reproduce the problem. The code is based on a Stackoverflow example.

Code:
package dell_d6000;

import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Label;
import javax.swing.JFrame;

public class Demo {
	private static void print(String name) {
		System.out.println(name);
	}
	private static void print(String name, Object value) {
		System.out.println(name + ": '" + value + "'");
	}
	public static void main(String[] args) {
		print("=== Start ===");
		final GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
		print("localGraphicsEnvironment", localGraphicsEnvironment);
		final GraphicsDevice defaultScreenDevice = localGraphicsEnvironment.getDefaultScreenDevice();
		print("defaultScreenDevice", defaultScreenDevice);
		final GraphicsConfiguration defaultConfiguration = defaultScreenDevice.getDefaultConfiguration();
		print("defaultConfiguration", defaultConfiguration);
		print("'new JFrame(\"Demo\");' will produce a NullPointerException when defaultConfiguration is null. This is a DisplayLink Driver 5.1 bug");
		final JFrame frame = new JFrame("Demo");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().add(new Label("*** Hello World! ***"));
		frame.pack();
		frame.setVisible(true);
		print("==== End ====");
	}
}
I get the following output with closed lid (or open lid with mirroring enabled):

Code:
=== Start ===
localGraphicsEnvironment: 'sun.awt.CGraphicsEnvironment@3d075dc0'
defaultScreenDevice: 'sun.awt.CGraphicsDevice@214c265e'
defaultConfiguration: 'null'
'new JFrame("Demo");' will produce a NullPointerException when defaultConfiguration is null. This is a DisplayLink Driver 5.1 bug
Exception in thread "main" java.lang.NullPointerException
	at java.awt.Window.init(Window.java:497)
	at java.awt.Window.<init>(Window.java:537)
	at java.awt.Frame.<init>(Frame.java:420)
	at javax.swing.JFrame.<init>(JFrame.java:233)
	at dell_d6000.Demo.main(Demo.java:29)
And I get the following, expected output with open lid and mirroring disabled (JFrame is shown on the macBook screen):

Code:
=== Start ===
localGraphicsEnvironment: 'sun.awt.CGraphicsEnvironment@6d03e736'
defaultScreenDevice: 'sun.awt.CGraphicsDevice@568db2f2'
defaultConfiguration: 'CGLGraphicsConfig[dev=69733447,pixfmt=0]'
'new JFrame("Demo");' will produce a NullPointerException when defaultConfiguration is null. This is a DisplayLink Driver 5.1 bug
==== End ====
This issue is related to:

- https://www.displaylink.org/forum/sh...ad.php?t=66114
- https://stackoverflow.com/questions/...rtup-on-mac-os

A fix for this issue would be very much appreciated.

Thank you.

Last edited by phs; 03-20-2019 at 08:13 AM. Reason: Formatted second result
phs is offline   Reply With Quote
Old 03-21-2019, 02:07 PM   #2
ivarss
Junior Member
 
Join Date: Mar 2019
Posts: 1
Default

Same here with MBP 2018 and DisplayLink v5.1. Even Java Control Panel does not start from System Preferences in clamshell mode.
Probably has to do something with the fact that Java wants to switch graphics cards on startup, but is confused to find DisplayPort instead. Just guessing though.

Java software works fine if you start it with DisplayPort not connected and connect it later.
ivarss is offline   Reply With Quote
Old 05-02-2019, 12:32 PM   #3
phs
Junior Member
 
Join Date: Mar 2019
Posts: 4
Default

Since the sample code works with JDK7 but not with newer JDKs, it might be a JDK bug.

See https://bugs.openjdk.java.net/browse/JDK-8223158
phs is offline   Reply With Quote
Old 12-24-2019, 12:02 PM   #4
phs
Junior Member
 
Join Date: Mar 2019
Posts: 4
Default

fyi.

It was solved based on an Oracle Support Request I've opened.

It was a JDK Bug. Fixed with JDK1.0.8_231-b34. I tested it also successfully with JDK11.0.5.

See also https://bugs.openjdk.java.net/browse/JDK-8223158
phs is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:41 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.