Bug 1303132 - engine-setup js-ant failed to execute with java 1.8
engine-setup js-ant failed to execute with java 1.8
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine-reports
Classification: oVirt
Component: Setup (Show other bugs)
3.6.2
x86_64 Linux
urgent Severity urgent (vote)
: ovirt-3.6.5
: 3.6.5.1
Assigned To: Yedidyah Bar David
Petr Kubica
: Regression
: 1313585 1322818 1323127 (view as bug list)
Depends On: 1324473
Blocks: 1315631
  Show dependency treegraph
 
Reported: 2016-01-29 11:10 EST by Alexander Wigen
Modified: 2016-04-21 10:35 EDT (History)
17 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: jaseperreports does not work well with java 1.8. The engine works with both 1.7 and 1.8. There is a single script to choose which java to use, used by both the engine and reports, and it accepts both. The reports package required java 1.7 but did not conflict with 1.8. Consequence: If a machine had both java 1.7 and 1.8 installed, and 1.8 was the default, jasperreports would fail during engine-setup. Fix: The code was changed to allow different java versions for engine and reports - 1.7 or 1.8 for the engine and only 1.7 for reports. Result: jasperreports does not fail. A workaround for previous versions is to change the default back to 1.7 using 'update-alternatives --config java'.
Story Points: ---
Clone Of:
: 1324473 (view as bug list)
Environment:
Last Closed: 2016-04-21 10:35:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Reports
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑3.6.z+
rule-engine: blocker+
ylavi: planning_ack+
dfediuck: devel_ack+
pnovotny: testing_ack+


Attachments (Terms of Use)
engine-setup log (3.82 MB, text/plain)
2016-01-29 11:10 EST, Alexander Wigen
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 53773 ovirt-engine-reports-3.6 MERGED packaging: spec: Conflict with jre 1.8 2016-03-01 03:24 EST
oVirt gerrit 55606 None None None 2016-04-03 09:36 EDT
oVirt gerrit 55618 master MERGED packaging: Allow different java home per component 2016-04-04 07:12 EDT
oVirt gerrit 55619 master MERGED packaging: Have own java home 2016-04-04 05:55 EDT
oVirt gerrit 55648 ovirt-engine-3.6 MERGED packaging: Allow different java home per component 2016-04-04 08:13 EDT
oVirt gerrit 55649 ovirt-engine-reports-3.6 MERGED packaging: Have own java home 2016-04-04 09:07 EDT
oVirt gerrit 55650 ovirt-engine-3.6.5 MERGED packaging: Allow different java home per component 2016-04-04 08:18 EDT

  None (edit)
Description Alexander Wigen 2016-01-29 11:10:09 EST
Created attachment 1119474 [details]
engine-setup log

Description of problem:
When running engine-setup with reports installation fails to execute stage 'Misc configuration': Command './js-ant' failed to execute

Version-Release number of selected component (if applicable):
3.6.2

How reproducible:
Start without DWH/Reports installed then install and run engine-setup

Actual results:
engine-setup fails and rolls back

Expected results:
engine-setup configures DWH/Reports correctly

Additional info:
It's possible I hit bug #1113094 first as I didn't have a DNS server configured which resolved this hostname. After I configured a DNS server to correctly resolve the hostname the engine-setup log now shows RunTimeException:

[java] Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: jar:file:/usr/share/jasperreports-server/buildomatic/conf_source/ieCe/lib/saxonhe-9.2.1.5.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
Comment 1 Yedidyah Bar David 2016-01-31 10:07:13 EST
Seems like you have openjdk 1.8.

Can you try removing it and installing only 1.7?
Comment 2 Alexander Wigen 2016-01-31 16:50:55 EST
Thanks Yedidyah that was the problem. Should I close this ticket or should there be a check added somewhere?
Comment 3 Yedidyah Bar David 2016-02-01 02:34:21 EST
(In reply to Alexander Wigen from comment #2)
> Thanks Yedidyah that was the problem. Should I close this ticket or should
> there be a check added somewhere?

Changed the subject for now. Thanks for the report!

reports requires 1.7, but uses whatever the common code (in the engine) chooses.

In <= 3.5 both needed 1.7 so all was ok.

In 3.6 the engine can use either 1.7 or 1.8, and if 1.8 is your default, will pick it up, which fails reports.

See also bug 1211709 comment 5.

We should make the reports plugin in setup choose its own jre (1.7 for now).
Comment 4 Yedidyah Bar David 2016-02-21 10:21:16 EST
Relevant test flows (both for reproduction, using a broken version, and for verification, using a fixed version - behavior will be different):

1. Should check on all of:
centos 6 and 7
rhel 6 and 7
We do not ship 3.6 reports builds for fedora currently

2. Simple:
Install a clean os
Install engine+dwh+reports
setup

3. Pre-install 1.8
Install clean OS
yum install java-1.8.0-openjdk
install engine+dwh+reports
setup

4. Upgrade
Install clean OS
install older engine+dwh+reports
setup
yum install java-1.8.0-openjdk
setup

See also bug 1140746. Current is in principle a duplicate.
Comment 5 Yedidyah Bar David 2016-02-21 10:26:20 EST
Forgot to add: For broken versions, which do not prevent 1.8, you can also try changing the default using 'update-alternatives --config java'. If you choose 1.7, reports will still work. This is also a workaround.
Comment 6 Yedidyah Bar David 2016-03-02 05:22:18 EST
Copying the specific error message from the setup log, so it's easier to find:

     [java] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionModelService' defined in file [/usr/share/jasperreports-server/buildomatic/conf_source/ieCe/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
Comment 7 Yedidyah Bar David 2016-03-07 08:22:11 EST
*** Bug 1313585 has been marked as a duplicate of this bug. ***
Comment 8 Petr Kubica 2016-04-01 04:54:15 EDT
Verified with rhevm-reports-setup-3.6.5-1.el6ev.noarch

rhevm-reports-setup conflicts with 1:java-1.8.0-openjdk-headless-1.8.0.77-2.b03.el6.x86_64
Comment 9 Yedidyah Bar David 2016-04-03 05:30:30 EDT
Not sure how this was VERIFIED when bug 1322528 is one of the flows that should have been tested, see comment 4.

Moving back to assigned.

Next plans:

1. Revert the existing patches for current bug.

2. Copy existing engine's script java-home to java-home-reports which will be adapted for Reports needs. Currently this will mean to first try 1.7.0, then system default, and only allow 1.7.0.
Comment 10 Red Hat Bugzilla Rules Engine 2016-04-03 05:30:37 EDT
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.
Comment 11 Yedidyah Bar David 2016-04-03 09:38:01 EDT
55606 is reverting the previous patch to conflict with java 1.8.
Comment 12 Shirly Radco 2016-04-04 03:10:47 EDT
*** Bug 1322818 has been marked as a duplicate of this bug. ***
Comment 13 Gil Klein 2016-04-04 04:59:35 EDT
Setting this BZ as urgent severity due to the impact on the very basic upgrade flow (described in BZ #1322818)
Comment 14 Yedidyah Bar David 2016-04-04 08:51:42 EDT
Note to QE and a summary:

Test flows are discussed in comment 4. In addition, since the fix is different now that when it was written (see below), you can also change the default java version (with update-alternatives --config java), restart services, and see how they are affected. You can (also) use 'ps' to find the pid of each of engine/dwh/reports java process and ls -l /proc/PID/exe to see which version it actually runs under.

We tried to fix this bug by conflicting with java 1.8. This turned out to not work well, see bug 1323461.

The current solution, instead, allow different java versions to be used for the engine and for reports. In 3.6, the engine can use either 1.7 or 1.8, and reports requires 1.7.
Comment 15 Nikolai Sednev 2016-04-06 12:31:52 EDT
I've done upgrade as described in https://bugzilla.redhat.com/show_bug.cgi?id=1308885, without any problems.
Works for me on latest engine rhevm-3.6.5.1-0.1.el6.noarch.
java_cup-0.10k-5.el6.x86_64
java-1.6.0-openjdk-1.6.0.38-1.13.10.0.el6_7.x86_64
javassist-eap6-3.18.1-6.GA_redhat_1.1.ep6.el6.noarch
java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
java-1.7.0-openjdk-1.7.0.99-2.6.5.0.el6_7.x86_64
Comment 16 Nikolai Sednev 2016-04-06 12:33:53 EDT
Adding more components from the engine:
rhevm-dwh-3.6.2-1.el6ev.noarch
rhevm-reports-3.6.5-1.el6ev.noarch
ovirt-vmconsole-1.0.0-1.el6ev.noarch
ovirt-host-deploy-1.4.1-1.el6ev.noarch
ovirt-host-deploy-java-1.4.1-1.el6ev.noarch
ovirt-vmconsole-proxy-1.0.0-1.el6ev.noarch
ovirt-engine-extension-aaa-jdbc-1.0.6-1.el6ev.noarch
ovirt-setup-lib-1.0.1-1.el6ev.noarch

rhevm-vmconsole-proxy-helper-3.6.5.1-0.1.el6.noarch
rhevm-backend-3.6.5.1-0.1.el6.noarch
rhevm-setup-plugin-vmconsole-proxy-helper-3.6.5.1-0.1.el6.noarch
rhevm-log-collector-3.6.1-1.el6ev.noarch
rhevm-spice-client-x64-msi-3.6-6.el6.noarch
rhevm-tools-backup-3.6.5.1-0.1.el6.noarch
rhevm-tools-3.6.5.1-0.1.el6.noarch
rhevm-reports-setup-3.6.5-1.el6ev.noarch
rhevm-guest-agent-common-1.0.11-2.el6ev.noarch
rhevm-3.6.5.1-0.1.el6.noarch
rhevm-sdk-python-3.6.5.0-1.el6ev.noarch
rhevm-extensions-api-impl-3.6.5.1-0.1.el6.noarch
rhevm-dwh-setup-3.6.2-1.el6ev.noarch
rhevm-spice-client-x86-cab-3.6-6.el6.noarch
rhevm-webadmin-portal-3.6.5.1-0.1.el6.noarch
rhevm-dwh-3.6.2-1.el6ev.noarch
rhevm-lib-3.6.5.1-0.1.el6.noarch
rhevm-setup-plugin-ovirt-engine-common-3.6.5.1-0.1.el6.noarch
rhevm-setup-3.6.5.1-0.1.el6.noarch
rhevm-iso-uploader-3.6.0-1.el6ev.noarch
rhevm-spice-client-x86-msi-3.6-6.el6.noarch
rhevm-branding-rhev-3.6.0-9.el6ev.noarch
rhevm-restapi-3.6.5.1-0.1.el6.noarch
rhevm-reports-3.6.5-1.el6ev.noarch
rhevm-setup-plugin-websocket-proxy-3.6.5.1-0.1.el6.noarch
rhevm-websocket-proxy-3.6.5.1-0.1.el6.noarch
rhevm-spice-client-x64-cab-3.6-6.el6.noarch
rhevm-dbscripts-3.6.5.1-0.1.el6.noarch
rhevm-setup-base-3.6.5.1-0.1.el6.noarch
rhevm-setup-plugin-ovirt-engine-3.6.5.1-0.1.el6.noarch
rhevm-image-uploader-3.6.0-1.el6ev.noarch
rhevm-doc-3.6.0-6.el6eng.noarch
rhevm-userportal-3.6.5.1-0.1.el6.noarch
rhevm-setup-plugins-3.6.3-1.el6ev.noarch
rhevm-cli-3.6.2.0-1.el6ev.noarch
rhevm-dependencies-3.6.0-1.el6ev.noarch
Comment 17 Yedidyah Bar David 2016-04-10 05:11:58 EDT
*** Bug 1323127 has been marked as a duplicate of this bug. ***
Comment 18 Lukas Svaty 2016-04-14 04:50:17 EDT
VERIFIED on up to date RHEL-6.7

Used suggested scenarios of simple installation engine+dwh+reports, upgrade test and scenario with preinstalled java 1.8. In all cases installation of packages does not have conflict as it previously have in other bug and engine setup does not report any issues during installation.
Comment 19 Petr Kubica 2016-04-14 07:11:35 EDT
It was also tested with oVirt 3.6.6 on CentOS 6 & 7 -> without any issues during installation

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