java.lang.reflect.InaccessibleObjectException

Unable to make member of class sun.security.provider.Sun accessible: module java.base does not export sun.security.provider to unnamed module @45b9a632 at sun.reflect.Reflection.throwInaccessibleObjectException(java.base@9-internal/Reflection.java:420) at java.lang.reflect.AccessibleObject.checkCanSetAccessible(java.base@9-internal/AccessibleObject.java:174) at java.lang.reflect.Constructor.checkCanSetAccessible(java.base@9-internal/Constructor.java:183) at java.lang.reflect.Constructor.setAccessible(java.base@9-internal/Constructor.java:176)

Solutions on the web39

  • via GitHub by jfly
    , 10 months ago
    Unable to make member of class sun.security.provider.Sun accessible: module java.base does not export sun.security.provider to unnamed module @45b9a632 at sun.reflect.Reflection.throwInaccessibleObjectException(java.base@9-internal/Reflection.java
  • Unable to make member of class com.sun.management.internal.OperatingSystemImpl accessible: module jdk.management does not export com.sun.management.internal to unnamed module @41e68d87 at
  • via Stack Overflow by brandboat
    , 7 months ago
    Unable to make field transient java.net.URLStreamHandler java.net.URL.handler accessible: module java.base does not "opens java.net" to unnamed module @4973813a at java.base/jdk.internal.reflect.Reflection.throwInaccessibleObjectException
  • Stack trace

    • java.lang.reflect.InaccessibleObjectException: Unable to make member of class sun.security.provider.Sun accessible: module java.base does not export sun.security.provider to unnamed module @45b9a632 at sun.reflect.Reflection.throwInaccessibleObjectException(java.base@9-internal/Reflection.java:420) at java.lang.reflect.AccessibleObject.checkCanSetAccessible(java.base@9-internal/AccessibleObject.java:174) at java.lang.reflect.Constructor.checkCanSetAccessible(java.base@9-internal/Constructor.java:183) at java.lang.reflect.Constructor.setAccessible(java.base@9-internal/Constructor.java:176) at com.google.gson.internal.ConstructorConstructor.newDefaultConstructor(ConstructorConstructor.java:97) at com.google.gson.internal.ConstructorConstructor.get(ConstructorConstructor.java:79) at com.google.gson.internal.bind.MapTypeAdapterFactory.create(MapTypeAdapterFactory.java:127) at com.google.gson.Gson.getAdapter(Gson.java:356) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:55) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) at com.google.gson.internal.bind.ArrayTypeAdapter.write(ArrayTypeAdapter.java:93) at com.google.gson.Gson.toJson(Gson.java:593) at com.google.gson.Gson.toJson(Gson.java:572) at com.google.gson.Gson.toJson(Gson.java:527) at com.google.gson.Gson.toJson(Gson.java:507) at net.gnehzr.tnoodle.server.webscrambles.ScrambleHandler.wrappedService(ScrambleHandler.java:71) at net.gnehzr.tnoodle.server.SafeHttpServlet.service(SafeHttpServlet.java:41) at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) at winstone.ServletConfiguration.execute(ServletConfiguration.java:249) at winstone.RequestDispatcher.forward(RequestDispatcher.java:335) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378) at net.gnehzr.tnoodle.server.HtmlInjectFilter.doFilter(HtmlInjectFilter.java:40) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at winstone.RequestDispatcher.forward(RequestDispatcher.java:333) at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244) at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.