Bug 1266272 - [GSS](6.4.z) org.jboss.as.cli.gui.GuiMain should not fail if JBOSS_HOME not set
[GSS](6.4.z) org.jboss.as.cli.gui.GuiMain should not fail if JBOSS_HOME not set
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI (Show other bugs)
6.4.3
Unspecified Unspecified
unspecified Severity high
: CR1
: EAP 6.4.12
Assigned To: Brad Maxwell
Petr Kremensky
eap6412-proposed
: Regression
Depends On:
Blocks: 1266626 eap6412-payload
  Show dependency treegraph
 
Reported: 2015-09-24 19:47 EDT by Brad Maxwell
Modified: 2017-01-17 08:09 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-17 08:09:45 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Brad Maxwell 2015-09-24 19:47:07 EDT
When using jconsole from the JDK something like this:

$JAVA_HOME/bin/jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:./jboss-cli-client.jar -J-Djava.util.logging.config.file=logging-jconsole.properties

The org.jboss.as.cli.gui.GuiMain makes a call to locate a product specific image:

java.net.URL iconURL = org/jboss/as/cl/gui/GuiMain.getResource(getCliIconPath());

getCliIconPath() is looking in JBOSS_HOME to identify which product this is to return a product specific image it appears.

ProductConfig productConfig = new ProductConfig(Module.getBootModuleLoader(), System.getenv("JBOSS_HOME"), null);
iconPath = productConfig.getCliIcon();

We have seen a case when JBOSS_HOME is not set and jconsole is used from the JDK with jboss-cli-client.jar on the classpath that it causes a NPE.  We should check for null and either use a default image from the client jar or such.

Caused by: java.lang.NullPointerException
	at sun.misc.MetaIndex.mayContain(MetaIndex.java:243)
	at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:830)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:199)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:251)
	at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1305)
	at java.lang.ClassLoader.getResource(ClassLoader.java:1144)
	at java.lang.ClassLoader.getResource(ClassLoader.java:1142)
	at java.lang.Class.getResource(Class.java:2147)
	at org.jboss.as.cli.gui.GuiMain.<clinit>(GuiMain.java:63)
Comment 8 Mike McCune 2016-03-28 18:21:14 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 9 Ivo Hradek 2016-11-22 11:02:44 EST
Verified with EAP 6.4.12.CP.CR1;
Comment 10 Petr Penicka 2017-01-17 08:09:45 EST
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.

Note You need to log in before you can comment on or make changes to this bug.