Sanjay
Sanjay

Reputation: 315

java 9 modules causing errors

Recently we have started migrating to java 17 from 8. We found some jaxb exceptions (shown below) which got resolved after adding --add-opens=java.base/java.lang=ALL-UNNAMED. I am not sure if this is correct fix. what this statement means? I know since java 9, modular concept has been introduced to have strong encapsulation. What is the correct fix?

Exception=Caused by: java.lang.ExceptionInInitializerError: Exception 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 @2a80c53

Upvotes: 0

Views: 81

Answers (0)

Related Questions