Description of problem: An EAP/AS5 instance in inventory can not be (re)started out of the box. (re)start fails with a message that the property 'javaHome' is not set. This is a regression over the AS4 plugin, where this property is not needed java.lang.IllegalStateException: The 'javaHome' connection property must be set in order to start the application server or to stop it via script. at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.initProcessExecution(ApplicationServerOperationsDelegate.java:284) at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.start(ApplicationServerOperationsDelegate.java:230) at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.invoke(ApplicationServerOperationsDelegate.java:142) at org.rhq.plugins.jbossas5.ApplicationServerComponent.invokeOperation(ApplicationServerComponent.java:495)
I am not clear where the regression is. In the AS 5 plugin we have, // ApplicationServerOperationsDelegate.initProcessExecution() ... File javaHomeDir = getJavaHomePath(); if (javaHomeDir == null) { throw new IllegalStateException( "The '" + ApplicationServerPluginConfigurationProperties.JAVA_HOME + "' connection property must be set in order to start the application server or to stop it via script."); } ... then in the AS 4 plugin we have virtually identical code, // JBossASServerOperationsDelegate.initProcessExecution() ... File javaHomeDir = this.serverComponent.getJavaHomePath(); if (javaHomeDir == null) { throw new IllegalStateException("The '" + JBossASServerComponent.JAVA_HOME_PATH_CONFIG_PROP + "' connection property must be set in order to start or stop JBossAS via script."); } Heiko, can you provide some additional information about what problems you are seeing. Based on the above code from the two plugins, it seems that their behavior is the same with respect to requiring the javaHome property being set.
The difference is that in the AS4 plugin, if we can't determine the java home from the AS process's environment, we default to using the java home from the RHQ Agent JVM. As I recall, we intentionally changed this behavior in the AS5 plugin, because Charles did not think it made sense to default to the same java installation used by the Agent. If the AS5 plugin cannot determine the java home during discovery by looking at the AS process's environment, then it logs the following message at DEBUG level: Unable to determine the JAVA_HOME environment variable for the JBoss AS process. the Agent is probably running as a user that does not have access to the AS process's environment. And it does not set any value for the javaHome conn prop, thereby requiring the user to set it manually via the GUI. Perhaps we should log this message at INFO instead, so a user has a better chance of seeing it in the Agent log.
Info level is needed in any case - perhaps even warn. Also: why not just falling back to the agent VM if no specific VM can be found? To be honest: It did, after it just worked for AS4 , not occur to me to look at the agent log if there are any hints / messages about this. I was just looking at Operations, which work out of the box on AS4, but not on AS5.
I have reviewed this issue with Ian. The plugin is behaving as intended based on comment 2 from Ian. I went ahead and changed the logging level to WARN for the statement that says the plugin could not determine JAVA_HOME. commit hash: 43130d136b9d8b4fc94d65dc6db5ab9a2912149e For verification I guess we ought to check that, "Unable to determine the JAVA_HOME environment variable for the JBoss AS process. the Agent is probably running as a user that does not have access to the AS process's environment." is logged with a WARN level during discovery when JAVA_HOME is not set or cannot otherwise be determined.
QA Verified.
Mass-closure of verified bugs against JON.