Bug 1266272

Summary: [GSS](6.4.z) org.jboss.as.cli.gui.GuiMain should not fail if JBOSS_HOME not set
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Brad Maxwell <bmaxwell>
Component: CLIAssignee: Brad Maxwell <bmaxwell>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4.3CC: bbaranow, bmaxwell, brian.stansberry, cdewolf, ihradek, jboss-set, jtruhlar, ppalaga
Target Milestone: CR1Keywords: Regression
Target Release: EAP 6.4.12   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: eap6412-proposed
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-17 13:09:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1266626, 1375585    

Description Brad Maxwell 2015-09-24 23:47:07 UTC
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 22:21:14 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 9 Ivo Hradek 2016-11-22 16:02:44 UTC
Verified with EAP 6.4.12.CP.CR1;

Comment 10 Petr Penicka 2017-01-17 13:09:45 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.