Bug 1303132

Summary: engine-setup js-ant failed to execute with java 1.8
Product: [Retired] ovirt-engine-reports Reporter: Alexander Wigen <alex>
Component: SetupAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kubica <pkubica>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.6.2CC: alex, bugs, dfediuck, didi, dmc, gklein, jbelka, lsvaty, lveyde, nsednev, rmartins, sbonazzo, sradco, stirabos, v.astafiev, v.badalyan, ylavi
Target Milestone: ovirt-3.6.5Keywords: Regression
Target Release: 3.6.5.1Flags: rule-engine: ovirt-3.6.z+
rule-engine: blocker+
ylavi: planning_ack+
dfediuck: devel_ack+
pnovotny: testing_ack+
Hardware: x86_64   
OS: Linux   
Whiteboard:
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 14:35:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Reports RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1324473    
Bug Blocks: 1315631    
Attachments:
Description Flags
engine-setup log none

Description Alexander Wigen 2016-01-29 16:10:09 UTC
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 15:07:13 UTC
Seems like you have openjdk 1.8.

Can you try removing it and installing only 1.7?

Comment 2 Alexander Wigen 2016-01-31 21:50:55 UTC
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 07:34:21 UTC
(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 15:21:16 UTC
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 15:26:20 UTC
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 10:22:18 UTC
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 13:22:11 UTC
*** Bug 1313585 has been marked as a duplicate of this bug. ***

Comment 8 Petr Kubica 2016-04-01 08:54:15 UTC
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 09:30:30 UTC
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 09:30:37 UTC
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 13:38:01 UTC
55606 is reverting the previous patch to conflict with java 1.8.

Comment 12 Shirly Radco 2016-04-04 07:10:47 UTC
*** Bug 1322818 has been marked as a duplicate of this bug. ***

Comment 13 Gil Klein 2016-04-04 08:59:35 UTC
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 12:51:42 UTC
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 16:31:52 UTC
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 16:33:53 UTC
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 09:11:58 UTC
*** Bug 1323127 has been marked as a duplicate of this bug. ***

Comment 18 Lukas Svaty 2016-04-14 08:50:17 UTC
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 11:11:35 UTC
It was also tested with oVirt 3.6.6 on CentOS 6 & 7 -> without any issues during installation