Bug 837638

Summary: [RHEVM Installer] ovirt-engine should use java-1.7
Product: Red Hat Enterprise Virtualization Manager Reporter: Kiril Nesenko <knesenko>
Component: ovirt-engine-setupAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: bazulay, dfediuck, dyasny, iheim, juan.hernandez, mgoldboi, oramraz, Rhev-m-bugs, ykaul
Target Milestone: ---Flags: mgoldboi: needinfo+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration infra
Fixed In Version: si12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 20:01:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kiril Nesenko 2012-07-04 13:56:27 UTC
Description of problem:
ovirt-engine should use java-1.7 instead of java-1.6.

[root@vm-17-67 yum.repos.d]# lsof -p 11330 | grep /usr/lib/jvm
java    11330 ovirt  txt    REG              253,0    36072 160488 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java
java    11330 ovirt  mem    REG              253,0  3534509 160547 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/charsets.jar
java    11330 ovirt  mem    REG              253,0   243115 271086 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext/sunpkcs11.jar
java    11330 ovirt  mem    REG              253,0    32400 160528 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libnio.so
java    11330 ovirt  mem    REG              253,0    86096 160527 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libnet.so
java    11330 ovirt  mem    REG              253,0   523793 160580 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jsse.jar


Version-Release number of selected component (if applicable):
si9.1

How reproducible:
Always

Steps to Reproduce:
1. Start ovirt engine service
2. ps -u ovirt; lsof -p <pid_of_engine> | grep /bin/java
3.
  
Actual results:


Expected results:
ovirt-engine should use java-1.7 instead of java-1.6.

Additional info:

Comment 2 Juan Hernández 2012-07-04 14:12:44 UTC
When/if the following change is fixed the engine will refuse to start if the Java virtual machine currently selected with alternatives is not 1.7:

http://gerrit.ovirt.org/#/c/5894

However, this will not fix the issue.

I see two ways to fix it:

1. Change the RPM or the setup tool so that the alternatives command is used to select 1.7 by default. This has then inconvenient that the user can later use the alternatives command to change back to 1.6, maybe for other application, and the engine will refuse to start next time.

2. Change the start script (and the manage-domains and config tools) so that it uses 1.7 regardless of what is configured with alternatives.

Comment 3 Oded Ramraz 2012-07-11 20:39:43 UTC
I lost a lot of time today during si9.1 installation until I realized I'm not using the correct java version:

After I looked at the installation logs I realized that  rhevm-setup fails when it tries to use rhevm-config script: 

2012-07-11 22:57:03::DEBUG::common_utils::309::root:: Executing command --> '/usr/share/ovirt-engine/engine-config/engine-config -s CAEngineKey=/etc/pki/ovirt-engine/private/ca.pem --cver=general -p /usr/share/ovirt-engine/conf/engine-config-install.properties'
2012-07-11 22:57:04::DEBUG::common_utils::335::root:: output =
2012-07-11 22:57:04::DEBUG::common_utils::336::root:: stderr = org.apache.xpath.domapi.XPathStylesheetDOM3Exception: Prefix must resolve to a namespace: urn:jboss:domain:datasources:1.0

2012-07-11 22:57:04::DEBUG::common_utils::337::root:: retcode = 1
2012-07-11 22:57:04::DEBUG::setup_sequences::62::root:: Traceback (most recent call last):
  File "/usr/share/ovirt-engine/scripts/setup_sequences.py", line 60, in run
    function()
  File "/usr/bin/rhevm-setup", line 1060, in _updateVDCOptions
    raise Exception(output_messages.ERR_FAILED_UPD_VDC_OPTIONS%(sys.exc_info()[1]))
Exception: Failed updating configuration parameter: Error: failed updating configuration field CAEngineKey to /etc/pki/ovirt-engine/private/ca.pem

When i tried to run rhevm-config manually I've got the same error:
[root@wheat-vdc ~]# rhevm-config  --list
org.apache.xpath.domapi.XPathStylesheetDOM3Exception: Prefix must resolve to a namespace: urn:jboss:domain:datasources:1.0

Only after I run the following command i managed to install the setup properly :
alternatives --set java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

Setting / Raising the severity of this issue.

Comment 4 Juan Hernández 2012-07-12 07:57:29 UTC
Note that the errors that you were getting before running that "alternatives" command where probably caused because you had the IBM J9 virtual machine installed. That is a 1.7 virtual machine, so even if we fix this bug (as described in comment #2) we will still have the same problem.

We can redefine this bug as "ovirt-engine should use openjdk 1.7 regardless of what is installed and configured with alternatives". That or open a new bug.

Comment 5 Juan Hernández 2012-07-12 07:58:38 UTC
Another direction, and maybe another low priority bug, could be to make sure that the engine can work with the IBM J9 java virtual machine (version 1.7, of course).

Comment 6 Juan Hernández 2012-07-13 15:29:52 UTC
The suggested solution for this problem is here:

http://gerrit.ovirt.org/6223

Comment 7 Juan Hernández 2012-07-26 11:02:20 UTC
The change is already merged upstream:

http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=c40592222d4bf9c55bf72248d6ebac4a4efdf4ac