Bug 598951 - Regression over AS4 plugin: AS5 plugin requires 'javaHome' to be set for (re)start
Summary: Regression over AS4 plugin: AS5 plugin requires 'javaHome' to be set for (re)...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 3.0.0
Hardware: All
OS: All
urgent
medium
Target Milestone: ---
: ---
Assignee: John Sanda
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon-sprint11-bugs
TreeView+ depends on / blocked
 
Reported: 2010-06-02 12:09 UTC by Heiko W. Rupp
Modified: 2010-08-12 16:52 UTC (History)
2 users (show)

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-12 16:52:52 UTC
Embargoed:


Attachments (Terms of Use)

Description Heiko W. Rupp 2010-06-02 12:09:42 UTC
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-23 02:56:15 UTC
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 15:58:31 UTC
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 18:19:37 UTC
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 17:43:08 UTC
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 20:53:11 UTC
QA Verified.

Comment 6 Corey Welton 2010-08-12 16:52:52 UTC
Mass-closure of verified bugs against JON.


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