Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 598951 - Regression over AS4 plugin: AS5 plugin requires 'javaHome' to be set for (re)start
Regression over AS4 plugin: AS5 plugin requires 'javaHome' to be set for (re)...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
3.0.0
All All
urgent Severity medium (vote)
: ---
: ---
Assigned To: John Sanda
Corey Welton
:
Depends On:
Blocks: jon-sprint11-bugs
  Show dependency treegraph
 
Reported: 2010-06-02 08:09 EDT by Heiko W. Rupp
Modified: 2010-08-12 12:52 EDT (History)
2 users (show)

See Also:
Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-12 12:52:52 EDT
Type: ---
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 Heiko W. Rupp 2010-06-02 08:09:42 EDT
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)
Comment 1 John Sanda 2010-06-22 22:56:15 EDT
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.
Comment 2 Ian Springer 2010-06-28 11:58:31 EDT
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.
Comment 3 Heiko W. Rupp 2010-06-28 14:19:37 EDT
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.
Comment 4 John Sanda 2010-07-07 13:43:08 EDT
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.
Comment 5 Corey Welton 2010-07-08 16:53:11 EDT
QA Verified.
Comment 6 Corey Welton 2010-08-12 12:52:52 EDT
Mass-closure of verified bugs against JON.

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