Bug 1016609 - storage and agent service is not taking java exec from 'RHQ_SERVER_JAVA_HOME'
Summary: storage and agent service is not taking java exec from 'RHQ_SERVER_JAVA_HOME'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Installer
Version: JON 3.2
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ER06
: JON 3.2.0
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
URL:
Whiteboard:
: 1010270 (view as bug list)
Depends On:
Blocks: 1012435
TreeView+ depends on / blocked
 
Reported: 2013-10-08 12:04 UTC by Jeeva Kandasamy
Modified: 2014-06-13 14:33 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
installation-ps (8.36 KB, text/plain)
2013-10-08 12:04 UTC, Jeeva Kandasamy
no flags Details

Description Jeeva Kandasamy 2013-10-08 12:04:32 UTC
Created attachment 809240 [details]
installation-ps

Description of problem:
storage node is reporting warning to use oracle java release even though, oracle java home path set on 'RHQ_SERVER_JAVA_HOME'.

While installing/starting/stopping all the service it's asking to set 'RHQ_SERVER_JAVA_HOME' or 'RHQ_SERVER_JAVA_EXE_FILE_PATH'. I set RHQ_SERVER_JAVA_HOME oracle jdk location. However it's taking java exec from PATH environment variable. JON server only running with specified java exec path. Other services are running by PATH java exec.

[hudson@mercury bin]$ ./rhqctl status
There is no JVM available.
Please set RHQ_SERVER_JAVA_HOME or RHQ_SERVER_JAVA_EXE_FILE_PATH appropriately.
[hudson@mercury bin]$ export RHQ_SERVER_JAVA_HOME=/opt/applications/jdk1.7.0/

Storage node generates Warning like follows,
 WARN 16:36:00,663 OpenJDK is not recommended. Please upgrade to the newest Oracle Java release


Version-Release number of selected component (if applicable):
Version: 3.2.0.ER3
Build Number: c0742ed:cbad264
GWT Version: 2.5.0
SmartGWT Version: 3.0

Java Version:
[hudson@mercury bin]$ /opt/applications/jdk1.7.0/bin/java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
[hudson@mercury bin]$ 


How reproducible:
100%

Steps to Reproduce:
1. export RHQ_SERVER_JAVA_HOME=/opt/applications/jdk1.7.0/
2. ./rhqctl install

Actual results:
storage node and agent are taking java exec from PATH environment variable.

Expected results:
all the services modified by rhqctl should take from 'RHQ_SERVER_JAVA_HOME' or equivalent.

Additional info: ps status and installation sort log is attached

Comment 1 Heiko W. Rupp 2013-10-11 10:33:49 UTC
We need to define how to handle this.
Probably use RHQ_SERVER_JAVA_HOME if no specific RHQ_AGENT_JAVA_HOME or RHQ_STORAGE_JAVA_HOME are set. And as of now fall back to JAVA_HOME and PATH if the RHQ* ones are not set ?

Comment 2 Jay Shaughnessy 2013-10-11 13:37:58 UTC
*** Bug 1010270 has been marked as a duplicate of this bug. ***

Comment 3 Jay Shaughnessy 2013-10-11 13:47:42 UTC
There are actually several issues with our using the correct JVM at runtime.  While resolving these I'm going to apply a new, more consistent approach to the properties we define for specifying the JVM.  I'll introduce:

RHQ_JAVA_HOME
RHQ_JAVA_EXE_FILE_PATH

These will supersede the legacy, component-specific properties such as RHQ_SERVER_JAVA_HOME, RHQ_AGENT_JAVE_HOME, etc.  Although, the previous properties will be supported for backward compatibility, but the new properties will take precedence if both are defined.

We will fall back to JAVA_HOME if the RHQ-specific properties are not defined.  We will not (any longer) fall back to PATH settings.

Also, we have outdated comments about the use of embedded JRE's on the server and agent.  This will be fixed as we do not actually support embedded JRE's in any of out components.

Additionally, we will apply the resolved JRE to Cassandra as well, which was up to now picking up its JRE outside of our property settings for the storage node (meaning only the storage installer was using the expected setting.

Comment 4 Jay Shaughnessy 2013-10-11 21:03:00 UTC
A few commits for this work, as described in Comment 3:


master commit 4a8eee0468588fd4ad6241eba43785436622374d
Author: Jay Shaughnessy <jshaughn>
Date:   Fri Oct 11 11:07:05 2013 -0400

 Updates to JVM property handling - Part 1, .sh scripts

 - Update scripts to use new RHQ_JAVA_HOME and RHQ_JAVA_EXE_FILE_PATH properties.
 - Ensure rhqctl and all components (including the embedded cassandra) honor
   the JVM property settings
   - never fall back to PATH
   - eliminate references to embedded jre's in our components
   - keep back compatibility support for RHQ_SERVER_JAVA_XXX and RHQ_AGENT_XXX
     properties
     - note - new properties, if set, have preference.


master commit aba62e15a6387c029839f044b8d95a68f0aa5515
Author: Jay Shaughnessy <jshaughn>
Date:   Fri Oct 11 16:24:36 2013 -0400

 Updates to JVM property handling - Part 2, .bat scripts

 - Update scripts to use new RHQ_JAVA_HOME and RHQ_JAVA_EXE_FILE_PATH properties.
 - Ensure rhqctl and all components (including the embedded cassandra) honor 
   the JVM property settings
   - never fall back to PATH
   - eliminate references to embedded jre's in our components
   - keep back compatibility support for RHQ_SERVER_JAVA_XXX and RHQ_AGENT_XXX
     properties
     - note - new properties, if set, have preference.

 Also:
 - fixed an issue (there may be more) with installing rhq into a path 
   with spaces
 - fixed a deprecated script to have the correct messaging to use rhqctl


master commit 6f106dc26c747ce1dd8fbb0dfff14fa22433f2b0
Author: Jay Shaughnessy <jshaughn>
Date:   Fri Oct 11 13:35:06 2013 -0400

    Don't let the module depend on finding Java on the PATH

Comment 5 Jay Shaughnessy 2013-10-12 03:17:09 UTC
release3.2.x commit ef436dfb148cd49caf1f37f8e7146a7e15eab367

    cherry-pick 4a8eee0468588fd4ad6241eba43785436622374d


release3.2.x commit ba6aa73293b8a9a16697443d764bee5fc9898ba6

    cherry-pick aba62e15a6387c029839f044b8d95a68f0aa5515

release3.2.x commit 44c20f8360044ca246757c49f0ad374a102821a2

    cherry-pick 6f106dc26c747ce1dd8fbb0dfff14fa22433f2b0

Comment 6 Simeon Pinder 2013-10-24 04:10:03 UTC
Moving to ON_QA for testing in the next build.

Comment 7 Armine Hovsepyan 2013-10-29 15:16:39 UTC
verified

priorities are:RHQ_JAVA_EXE_FILE_PATH -> RHQ_SERVER_JAVA_EXE_FILE_PATH -> JAVA_HOME
RHQ_JAVA_HOME -> RHQ_SERVER_JAVA_HOME -> JAVA_HOME



No need to RHQ_AGENT_JAVA and/or RHQ_AGENT_JAVA_EXE_FILE_PATH.

In agent.sh the priorities are:
RHQ_JAVA_EXE_FILE_PATH -> RHQ_SERVER_JAVA_EXE_FILE_PATH -> JAVA_HOME
and  RHQ_AGENT_JAVA -> RHQ_AGENT_JAVA_EXE_FILE_PATH

Comment 8 Armine Hovsepyan 2013-10-30 16:37:50 UTC
reopening

when only RHQ_SERVER_JAVA_EXE_FILE_PATH is available, rhqctl still requires RHQ_JAVA_HOME or RHQ_JAVA_EXE_FILE_PATH

Comment 9 Mike Foley 2013-10-30 19:07:57 UTC
blocks jon 3.2 ga.  target milestone - er5

Comment 10 Jay Shaughnessy 2013-11-04 16:40:41 UTC
The problem is that RHQ_SERVER_JAVA_EXE_FILE_PATH is set incorrectly on the QE machine.  After visiting the test env I see:

[hudson@solpost ~]$ echo $RHQ_SERVER_JAVA_EXE_FILE_PATH
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin


From the comments/doco:

#    RHQ_JAVA_EXE_FILE_PATH - Defines the full path to the Java executable to
#                             use. If this is set, RHQ_JAVA_HOME is ignored.
#                             If this is not set, then $RHQ_JAVA_HOME/bin/java
#                             is used. If this and RHQ_JAVA_HOME are not set,
#                             then $JAVA_HOME/bin/java will be used.


The correct setting should be:

/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java

With this set correctly things work as expected. Setting back to MODIFIED.

Comment 11 Armine Hovsepyan 2013-11-05 08:46:14 UTC
verified 
thank you!

Comment 12 Armine Hovsepyan 2013-11-05 16:22:05 UTC
Note: minor issue visible:
when only RHQ_SERVER_JAVA_EXE_FILE_PATH is rovided rhqctl fails storage installation and asks for RHQ_JAVA_HOME or  RHQ_JAVA_EXE_FILE_PATH.

I don't think this is blocker - workaround would be just esporting this environmental variables or JAVA_HOME.


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