Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045594Openbravo ERPA. Platformpublic2020-12-16 16:002021-06-16 12:58
shuehner 
alostale 
normalminorhave not tried
closedfixed 
5
 
PR21Q3PR21Q3 
Core
No
0045594: Junit tests based on BaseWeldTest fail since jdk16 build ea28 (as weld tries to access no longer accessible jdk internals)
Running ant run.all.tests with jdk16ea28 build (at least) test fail with

Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @389008d1

java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @389008d1
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
    at org.jboss.weld.util.bytecode.ClassFileUtils$1.run(ClassFileUtils.java:88)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
    at org.jboss.weld.util.bytecode.ClassFileUtils.makeClassLoaderMethodsAccessible(ClassFileUtils.java:64)
    at org.jboss.weld.bootstrap.WeldStartup.startContainer(WeldStartup.java:220)

Running same with build ea27 does still work.

That looks like consequence of this JDK changes included in ea28 build:
https://openjdk.java.net/jeps/396 [^]

Can be reproduced with:
 ant run.test -Dtest=org.openbravo.client.application.test.MenuTest
Which fails (error message can be seen in src/result-org.openbravo.client.application.test.MenuTest.xml

Problem can be temporarily avoided by using:
export ANT_OPTS="--illegal-access=permit"
or
export ANT_OPTS="--illegal-access=debug"

Which undoes the new default behavior as as that 396 dep.

Note:
Behavior change is currently not listed in ea28 release notes
Download jdk16ea28 build or higher:
https://jdk.java.net/16/ [^]
Set JAVA_HOME to it
use
ant run.test -Dtest=org.openbravo.client.application.test.MenuTest
No tags attached.
related to design defect 0040840 closed platform Illegal Access warning in weld-core-impl-3.1.1.Final.jar using JDK12+ 
depends on feature request 0045593 closed platform Support JDK16 
blocks feature request 0045903 new Triage Platform Base Support JDK17 (LTS) 
blocks design defect 0047090 new Triage Platform Base Tracking issue: Library update 
Issue History
2020-12-16 16:00shuehnerNew Issue
2020-12-16 16:00shuehnerAssigned To => platform
2020-12-16 16:00shuehnerModules => Core
2020-12-16 16:00shuehnerTriggers an Emergency Pack => No
2020-12-16 16:00shuehnerRelationship addeddepends on 0045593
2020-12-16 16:01shuehnerNote Added: 0124888
2020-12-16 16:24shuehnerRelationship addedrelated to 0040840
2020-12-16 16:26shuehnerNote Added: 0124889
2021-02-16 11:42shuehnerNote Added: 0126124
2021-02-16 12:09shuehnerNote Edited: 0126124bug_revision_view_page.php?bugnote_id=0126124#r22127
2021-02-16 12:11shuehnerTarget Version => PR21Q2
2021-02-22 12:57shuehnerNote Added: 0126264
2021-03-31 06:59alostaleTarget VersionPR21Q2 => PR21Q3
2021-06-08 08:51alostaleStatusnew => scheduled
2021-06-08 08:51alostaleAssigned Toplatform => alostale
2021-06-08 08:58alostaleRelationship addedblocks 0045903
2021-06-08 15:26hgbotNote Added: 0129200
2021-06-09 08:01hgbotNote Added: 0129218
2021-06-11 17:45shuehnerRelationship addedblocks 0047090
2021-06-16 12:57hgbotResolutionopen => fixed
2021-06-16 12:57hgbotStatusscheduled => closed
2021-06-16 12:57hgbotNote Added: 0129556
2021-06-16 12:57hgbotFixed in Version => PR21Q3
2021-06-16 12:57hgbotNote Added: 0129557
2021-06-16 12:58hgbotNote Added: 0129559
2021-06-16 12:58hgbotNote Added: 0129560

Notes
(0124888)
shuehner   
2020-12-16 16:01   
Note that starting tomcat (in CI for webservice tests) did not fail.

So behavior maybe triggered by change doing during src-test invocation via Weld and not in normal usage in tomcat (just a theory)
(0124889)
shuehner   
2020-12-16 16:26   
Note that this to be triggered by the defaultbehavior change to deny in ea28 but the underlying problem we had already tracked in issue 40840 since early 2019.
(0126124)
shuehner   
2021-02-16 11:42   
(edited on: 2021-02-16 12:09)
That is fixed upstream in (not yet released) versions:
Fix Version/s: 4.0.1.Final
Fix Version/s: 3.1.7.Final

Currently we have 3.1.1 plan is targered smallest update (like a bugfix) to move to 3.1.7 (when it is released)

For reference changelog links from 3.1.2..3.1.6 to se changes:
3.1.2: https://issues.redhat.com/secure/ReleaseNote.jspa?projectId=12310891&version=12341958 [^]
3.1.3: https://issues.redhat.com/secure/ReleaseNote.jspa?projectId=12310891&version=12342783 [^]
3.1.4: https://issues.redhat.com/secure/ReleaseNote.jspa?projectId=12310891&version=12343306 [^]
3.1.5: https://issues.redhat.com/secure/ReleaseNote.jspa?projectId=12310891&version=12345341 [^]
3.1.5.SP1: https://issues.redhat.com/secure/ReleaseNote.jspa?projectId=12310891&version=12347084 [^]
3.1.6: https://issues.redhat.com/secure/ReleaseNote.jspa?projectId=12310891&version=12346955 [^]
3.1.7: No changelog (not yet released)

Out of thos3:
[WELD-2598] - Move Weld to Jakarta EE GAVs (from 3.1.3)
- could cascade to update a double of dependencies
- However as written in the issue (0 api-changes/behavior changes here) just reorganizing to be provided by jakarta EE (but without the package renaming)

(0126264)
shuehner   
2021-02-22 12:57   
Weld-Roadmap is showing: 2021-05-16 as planned release date for the 3.1.7:

https://issues.redhat.com/projects/WELD?selectedItem=com.atlassian.jira.jira-projects-plugin:release-page [^]
(0129200)
hgbot   
2021-06-08 15:26   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/380 [^]
(0129218)
hgbot   
2021-06-09 08:01   
Merge Request created: https://gitlab.com/openbravo/tools/platform/dependencies/-/merge_requests/2 [^]
(0129556)
hgbot   
2021-06-16 12:57   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/380 [^]
(0129557)
hgbot   
2021-06-16 12:57   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: c6a8cad3820e6369073476f655ab07f0ab36ee1f
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-06-16T12:51:51+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/c6a8cad3820e6369073476f655ab07f0ab36ee1f [^]

fixes ISSUE-45594: Illegal reflective access in Weld fails in JDK16+

Current weld version (3.1.1) has WELD-2662 [1] bug, which causes an
illegal access which prevents tests executions in JDK16+ due to an
stronger encapsulation implemented by JEP 396 [2].

It gets fixed by updating weld: 3.1.1 -> 3.1.7

Note the following transitive dependencies are not included:
  * weld-probe-core: it is a tool for developers
  * jboss-el-api: not required (inclued in src-test as a dependency for
    arquillian).
  * jboss-logging: included in core's lib/runtime as Hibernate
    dependency

[1] https://issues.redhat.com/browse/WELD-2662 [^]
[2] https://openjdk.java.net/jeps/396 [^]

---
A legal/EPL-2.0.txt
A modules/org.openbravo.base.weld/lib/runtime/jakarta.enterprise.cdi-api-2.0.2.jar
A modules/org.openbravo.base.weld/lib/runtime/jakarta.inject-api-1.0.jar
A modules/org.openbravo.base.weld/lib/runtime/jboss-annotations-api_1.3_spec-2.0.1.Final.jar
A modules/org.openbravo.base.weld/lib/runtime/jboss-interceptors-api_1.2_spec-2.0.0.Final.jar
A modules/org.openbravo.base.weld/lib/runtime/weld-api-3.1.SP4.jar
A modules/org.openbravo.base.weld/lib/runtime/weld-core-impl-3.1.7.SP1.jar
A modules/org.openbravo.base.weld/lib/runtime/weld-environment-common-3.1.7.SP1.jar
A modules/org.openbravo.base.weld/lib/runtime/weld-jsf-3.1.7.SP1.jar
A modules/org.openbravo.base.weld/lib/runtime/weld-servlet-core-3.1.7.SP1.jar
A modules/org.openbravo.base.weld/lib/runtime/weld-spi-3.1.SP4.jar
A modules/org.openbravo.base.weld/lib/runtime/weld-web-3.1.7.SP1.jar
M legal/Licensing.txt
R modules/org.openbravo.base.weld/lib/runtime/cdi-api-2.0.SP1.jar
R modules/org.openbravo.base.weld/lib/runtime/javax.inject-1.jar
R modules/org.openbravo.base.weld/lib/runtime/jboss-annotations-api_1.3_spec-1.0.0.Final.jar
R modules/org.openbravo.base.weld/lib/runtime/jboss-interceptors-api_1.2_spec-1.0.0.Final.jar
R modules/org.openbravo.base.weld/lib/runtime/weld-api-3.1.Final.jar
R modules/org.openbravo.base.weld/lib/runtime/weld-core-impl-3.1.1.Final.jar
R modules/org.openbravo.base.weld/lib/runtime/weld-environment-common-3.1.1.Final.jar
R modules/org.openbravo.base.weld/lib/runtime/weld-jsf-3.1.1.Final.jar
R modules/org.openbravo.base.weld/lib/runtime/weld-servlet-core-3.1.1.Final.jar
R modules/org.openbravo.base.weld/lib/runtime/weld-spi-3.1.Final.jar
R modules/org.openbravo.base.weld/lib/runtime/weld-web-3.1.1.Final.jar
---
(0129559)
hgbot   
2021-06-16 12:58   
Repository: https://gitlab.com/openbravo/tools/platform/dependencies [^]
Changeset: cf9b6cbe81abe09c7cbabbea10a1104bb0943444
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-06-16T10:57:45+00:00
URL: https://gitlab.com/openbravo/tools/platform/dependencies/-/commit/cf9b6cbe81abe09c7cbabbea10a1104bb0943444 [^]

ISSUE-45594: weld updated to 3.1.7

---
M build.gradle
---
(0129560)
hgbot   
2021-06-16 12:58   
Merge request merged: https://gitlab.com/openbravo/tools/platform/dependencies/-/merge_requests/2 [^]