title: InaccessibleObjectException after migrating from Java 8 to Java 11
body: <p>I am migrating a rather large monolith spring boot application from Java 8 to Java 11. After i've fixed the removed JEE modules, i ran into several reflection errors based on the strong encapsulation by the new introduced module system concept.</p>
  
  <p>Starting the application works with Java 11, however, performing a clean install via Maven doesnt work. There are several test failures caused by an InaccessibleObjectException due to reflection vs strong encapsulation.</p>
  
  <p><code>java.lang.reflect.InaccessibleObjectException: Unable to make field private jdk.internal.reflect.MethodAccessorImpl jdk.internal.reflect.DelegatingMethodAccessorImpl.delegate accessible: module java.base does not "opens jdk.internal.reflect" to unnamed module @6a969fb8 at com......(some Test-Method).</code></p>
  
  <p>I've already tried the solution suggested in that post <a href="https://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m">How to solve InaccessibleObjectException (&quot;Unable to make {member} accessible: module {A} does not &#39;opens {package}&#39; to {B}&quot;) on Java 9?</a>.</p>
  
  <p>But neither using the parameter <strong>--add-opens java.base/jdk.internal.reflect=ALL-UNNAMED</strong> as Maven argument nor storing it in the maven jvm.config helps.</p>
  
  <p>Are there any other approaches to get rid of these Exceptions?</p>