Bug 1266272 - [GSS](6.4.z) org.jboss.as.cli.gui.GuiMain should not fail if JBOSS_HOME not set
Summary: [GSS](6.4.z) org.jboss.as.cli.gui.GuiMain should not fail if JBOSS_HOME not set
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI
Version: 6.4.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: CR1
: EAP 6.4.12
Assignee: Brad Maxwell
QA Contact: Petr Kremensky
URL:
Whiteboard: eap6412-proposed
Depends On:
Blocks: 1266626 eap6412-payload
TreeView+ depends on / blocked
 
Reported: 2015-09-24 23:47 UTC by Brad Maxwell
Modified: 2019-08-15 05:31 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 13:09:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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