0

I'm trying to replace some ancient SunOne directory servers with 389 DS. I have a brand spankin new CentOS installation where I followed the steps as outlined here. My workstation is RHEL7, where I installed 389-console for the purposes of connecting remotely to aforementioned new LDAP server.

However when I attempt to launch 389-console locally, I get a java.awt.HeadlessException error. I bounced around google abit and almost everyone else I've seen post this issue where experiencing the same issue only they where trying to forward 389-console over X.

I would expect that this would just launch locally with no issue and the errors appear to be related to remote connectivity:

mose@localhost ~ $ 389-console 
Exception in thread "main" java.awt.HeadlessException
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
        at java.awt.Window.<init>(Window.java:536)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.JFrame.<init>(JFrame.java:189)
        at com.netscape.management.client.console.Console.<init>(Unknown Source)
        at com.netscape.management.client.console.Console.main(Unknown Source)

Workstation specific information:

mose@localhost ~ $ cat /etc/redhat-release 
Red Hat Enterprise Linux Client release 7.3 (Maipo)

mose@localhost ~ $ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b31)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b31, mixed mode)

mose@localhost ~ $ env | grep -i display
DISPLAY=:0

mose@localhost ~ $ sudo rpm -qa | grep 389
389-console-1.1.18-1.el7.noarch

mose@localhost ~ $ sudo rpm -qa | grep xauth
xorg-x11-xauth-1.0.9-1.el7.x86_64

I am running KDE as my GUI. I've also changed which Java I am using update-alternatives (Between openJDK and oracleJDK).

Full debug trace below:

mose@workstation ~ $ 389-console -D 9
java.util.prefs.userRoot=/home/mose/.389-console
java.runtime.name=OpenJDK Runtime Environment
sun.boot.library.path=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/amd64
java.vm.version=25.121-b13
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=:
java.vm.name=OpenJDK 64-Bit Server VM
file.encoding.pkg=sun.io
user.country=US
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=unknown
java.vm.specification.name=Java Virtual Machine Specification
user.dir=/home/mose
java.runtime.version=1.8.0_121-b13
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
java.endorsed.dirs=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/endorsed
os.arch=amd64
java.io.tmpdir=/tmp
line.separator=

java.vm.specification.vendor=Oracle Corporation
os.name=Linux
sun.jnu.encoding=UTF-8
java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.specification.name=Java Platform API Specification
java.class.version=52.0
sun.management.compiler=HotSpot 64-Bit Tiered Compilers
os.version=3.10.0-514.10.2.el7.x86_64
user.home=/home/mose
user.timezone=America/New_York
java.awt.printerjob=sun.print.PSPrinterJob
file.encoding=UTF-8
java.specification.version=1.8
java.class.path=/usr/lib/java/jss4.jar:/usr/share/java/ldapjdk.jar:/usr/share/java/idm-console-base.jar:/usr/share/java/idm-console-mcc.jar:/usr/share/java/idm-console-mcc_en.jar:/usr/share/java/idm-console-nmclf.jar:/usr/share/java/idm-console-nmclf_en.jar:/usr/share/java/389-console_en.jar
user.name=michael.moser
java.vm.specification.version=1.8
sun.java.command=com.netscape.management.client.console.Console -D 9
java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre
sun.arch.data.model=64
java.util.prefs.systemRoot=/home/mose/.389-console
user.language=en
java.specification.vendor=Oracle Corporation
awt.toolkit=sun.awt.X11.XToolkit
java.vm.info=mixed mode
java.version=1.8.0_121
java.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/ext:/usr/java/packages/lib/ext
sun.boot.class.path=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/jfr.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/classes
java.awt.headless=true
java.vendor=Oracle Corporation
file.separator=/
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
sun.io.unicode.encoding=UnicodeLittle
sun.cpu.endian=little
sun.cpu.isalist=
389-Management-Console/1.1.17 B2016.291.2035
RemoteImage: NOT found in cache loader589431969:com/netscape/management/nmclf/icons/Error.gif
RemoteImage: Create RemoteImage cache for loader589431969
RemoteImage: NOT found in cache loader589431969:com/netscape/management/nmclf/icons/Inform.gif
RemoteImage: NOT found in cache loader589431969:com/netscape/management/nmclf/icons/Warn.gif
RemoteImage: NOT found in cache loader589431969:com/netscape/management/nmclf/icons/Question.gif
ResourceSet: NOT found in cache loader589431969:com.netscape.management.client.components.components
Exception in thread "main" java.awt.HeadlessException
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
        at java.awt.Window.<init>(Window.java:536)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.JFrame.<init>(JFrame.java:189)
        at com.netscape.management.client.console.Console.<init>(Unknown Source)
        at com.netscape.management.client.console.Console.main(Unknown Source)
Michael Moser
  • 219
  • 2
  • 4
  • 16

2 Answers2

0

I found in the debug trace, that despite update-alternatives being configured for oracle JRE, 389-console was using openJDK. While openJDK was installed, I only had the headless version of it which is not sufficient to run the AWT library

Michael Moser
  • 219
  • 2
  • 4
  • 16
0

The problem is here:

sun.boot.library.path=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/lib/amd64
java.vm.version=25.121-b13

Create this variable:

export JAVA_HOME="DIRECTORY OF ORACLE JAVA"

and run again:

389-console -D 9
alexander.polomodov
  • 1,060
  • 3
  • 10
  • 14