Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045594Openbravo ERPA. Platformpublic2020-12-16 16:002021-06-16 12:58
normalminorhave not tried
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(
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(
    at java.base/java.lang.reflect.Method.setAccessible(
    at org.jboss.weld.util.bytecode.ClassFileUtils$
    at java.base/
    at org.jboss.weld.util.bytecode.ClassFileUtils.makeClassLoaderMethodsAccessible(
    at org.jboss.weld.bootstrap.WeldStartup.startContainer(

Running same with build ea27 does still work.

That looks like consequence of this JDK changes included in ea28 build: [^]

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"
export ANT_OPTS="--illegal-access=debug"

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

Behavior change is currently not listed in ea28 release notes
Download jdk16ea28 build or higher: [^]
Set JAVA_HOME to it
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 
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

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)
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.
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: [^]
3.1.3: [^]
3.1.4: [^]
3.1.5: [^]
3.1.5.SP1: [^]
3.1.6: [^]
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)

2021-02-22 12:57   
Weld-Roadmap is showing: 2021-05-16 as planned release date for the 3.1.7: [^]
2021-06-08 15:26   
Merge Request created: [^]
2021-06-09 08:01   
Merge Request created: [^]
2021-06-16 12:57   
Merge request merged: [^]
2021-06-16 12:57   
Directly closing issue as related merge request is already approved.

Repository: [^]
Changeset: c6a8cad3820e6369073476f655ab07f0ab36ee1f
Author: Asier Lostalé <>
Date: 2021-06-16T12:51:51+02:00
URL: [^]

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
  * jboss-logging: included in core's lib/runtime as Hibernate

[1] [^]
[2] [^]

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
2021-06-16 12:58   
Repository: [^]
Changeset: cf9b6cbe81abe09c7cbabbea10a1104bb0943444
Author: Asier Lostalé <>
Date: 2021-06-16T10:57:45+00:00
URL: [^]

ISSUE-45594: weld updated to 3.1.7

M build.gradle
2021-06-16 12:58   
Merge request merged: [^]