Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039663Openbravo ERPA. Platformpublic2018-11-21 13:592018-12-11 20:22
jarmendariz 
jarmendariz 
normalmajoralways
closedfixed 
5
 
3.0PR19Q1 
alostale
Core
39504
No
0039663: Build fails with Java11 starting from log4j upgrade
Build fails when using JDK11 after log4j2 upgrade with the following stacktrace:

/home/openbravo/Projects/issues/pi/build.xml:495: The following error occurred while executing this line:
/home/openbravo/Projects/issues/pi/src/build.xml:304: java.lang.ExceptionInInitializerError
    at org.openbravo.wad.validation.WADValidator.validate(WADValidator.java:60)
    at org.openbravo.wad.validation.WADValidatorTask.execute(WADValidatorTask.java:35)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:448)
    at org.apache.tools.ant.Target.performTasks(Target.java:469)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:446)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:448)
    at org.apache.tools.ant.Target.performTasks(Target.java:469)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1370)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
    at org.apache.tools.ant.Main.runBuild(Main.java:849)
    at org.apache.tools.ant.Main.startAnt(Main.java:228)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:283)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found.
    at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:555)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:580)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:567)
    at org.openbravo.wad.validation.WADValidationResult.<clinit>(WADValidationResult.java:35)
    ... 30 more
In a system using Java 11:

* Pull pi to its latest revision
* Execute ant install.source
No tags attached.
related to feature request 0038130 closed caristu Openbravo ERP support JDK 11 
caused by feature request 0039504 closed jarmendariz Openbravo ERP Upgrade Log4j to version 2 
related to feature request 0039664 new Triage Platform Base Openbravo ERP Replace ant Task subclasses to be executed as a java fork 
related to defect 0039795 closed staffrm Openbravo Deployment Options Build fails in PR19Q1 with Java 11 
Issue History
2018-11-21 13:59jarmendarizNew Issue
2018-11-21 13:59jarmendarizAssigned To => platform
2018-11-21 13:59jarmendarizModules => Core
2018-11-21 13:59jarmendarizRegression introduced by commit => 39504
2018-11-21 13:59jarmendarizTriggers an Emergency Pack => No
2018-11-21 14:00jarmendarizRelationship addedcaused by 0039504
2018-11-21 14:02jarmendarizRelationship addedrelated to 0038130
2018-11-21 14:03jarmendarizStatusnew => scheduled
2018-11-21 14:03jarmendarizAssigned Toplatform => jarmendariz
2018-11-21 14:09jarmendarizRelationship addedrelated to 0039664
2018-11-22 18:16shuehnerIssue Monitored: shuehner
2018-11-23 14:50hgbotCheckin
2018-11-23 14:50hgbotNote Added: 0108090
2018-11-23 14:50hgbotStatusscheduled => resolved
2018-11-23 14:50hgbotResolutionopen => fixed
2018-11-23 14:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bc617f478775a30c8f78191cdbe7404b96098f45 [^]
2018-11-27 12:57jarmendarizNote Added: 0108126
2018-11-30 11:17alostaleReview Assigned To => alostale
2018-11-30 11:17alostaleStatusresolved => closed
2018-11-30 11:17alostaleFixed in Version => 3.0PR19Q1
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108498
2018-12-13 13:43jarmendarizRelationship addedrelated to 0039795

Notes
(0108090)
hgbot   
2018-11-23 14:50   
Repository: erp/devel/pi
Changeset: bc617f478775a30c8f78191cdbe7404b96098f45
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Fri Nov 23 10:32:52 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bc617f478775a30c8f78191cdbe7404b96098f45 [^]

Fixed issue 39663: Build fails in Java 11 since log4j upgrade.

New log4j libraries are multi-release jars (mrjar), meaning that they can define
multiple version of classes depending on the JVM version being run. Currently
ant does not support mrjars for custom java tasks and build fails when executing
LogManager.getLogger() inside an ant task.
For this reason, a new jar is included during build to override LogManager and
StackLocator implementation to make build work in Java9+. In addition, classpath
in build script is modified to force including the build libraries first in the
classpath and use these classes instead of the ones implemented in log4j-api.

---
M build.xml
M src-db/database/build-create.xml
M src-db/database/build.xml
M src-util/diagnostic/build-create.xml
A lib/build/log4j-api-no-mrjar-2.11.1.jar
---
(0108126)
jarmendariz   
2018-11-27 12:57   
This issue has been reported to ant bug tracker:
https://bz.apache.org/bugzilla/show_bug.cgi?id=62952 [^]
(0108498)
hudsonbot   
2018-12-11 20:22   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/470e3cd384c5 [^]
Maturity status: Test