OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.16k stars 598 forks source link

Weld fails to create Proxy on OpenJDK17 #19876

Closed benjamin-confino closed 2 years ago

benjamin-confino commented 2 years ago

On OpenJDK17 we get errors such as this:

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 acces sible: module java.base does not "opens java.lang" to unnamed module @ec216b6

When CDI is trying to create a proxy.

The current suspect is https://openjdk.java.net/jeps/403 which would make this an intended change in java and the problem on our end.


Steps to reproduce

Clone https://github.com/OpenLiberty/openapi-ui-test-app Follow the instructions to build and run the app. Shut down the liberty server Download and configure the following JDK: https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz Run the server again, you should see an error during startup.


A full stack can be found in the attached FFDC file

ffdc_22.01.20_14.53.49.0.log

benjamin-confino commented 2 years ago

To make things more confusing. Dave Waddling was able to get a SOE run to pass on the above JDK. When I downloaded the built image from that build and repeated the above steps I could reproduce the error

https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_vYZFoHoYEeyxm-wYSNWOrg

benjamin-confino commented 2 years ago

And I'm closing this as a duplicate of #18412

A line in the java9 script is needed, without it we get this bug.