title: java.lang.IllegalAccessError: sun/security/provider/SunEntries
body: <p>I have been trying to solve my problem for a while now and couldn't find a solution yet.  I have migrated from Eclipse to Intellij IDEA a couple months ago and have been developing JSF/CDI web apps on Glassfish 5.  Now, I had to reinstall my whole system lately and whenever I try to deploy my web apps I get the following error:</p>
  <pre><code>exception
  javax.servlet.ServletException: sun/security/provider/SunEntries
  
  root cause
  java.lang.IllegalAccessError: sun/security/provider/SunEntries
  </code></pre>
  <p>The glassfish log shows the following:</p>
  <pre><code>java.lang.IllegalAccessError: tried to access class sun.security.provider.SunEntries from class com.sun.crypto.provider.SunJCE
      at com.sun.crypto.provider.SunJCE.putEntries(SunJCE.java:128)
      at com.sun.crypto.provider.SunJCE.&lt;init&gt;(SunJCE.java:111)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at java.lang.Class.newInstance(Class.java:442)
      at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:221)
      at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
      at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
      at sun.security.jca.ProviderList.getProvider(ProviderList.java:233)
      at sun.security.jca.ProviderList$ServiceList.tryGet(ProviderList.java:434)
      at sun.security.jca.ProviderList$ServiceList.access$200(ProviderList.java:376)
      at sun.security.jca.ProviderList$ServiceList$1.hasNext(ProviderList.java:486)
      at javax.crypto.KeyGenerator.nextSpi(KeyGenerator.java:338)
      at javax.crypto.KeyGenerator.&lt;init&gt;(KeyGenerator.java:168)
      at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:223)
      at com.sun.faces.util.ByteArrayGuardAESCTR.setupKeyAndCharset(ByteArrayGuardAESCTR.java:192)
      at com.sun.faces.util.ByteArrayGuardAESCTR.&lt;init&gt;(ByteArrayGuardAESCTR.java:97)
      at com.sun.faces.context.flash.ELFlash.&lt;init&gt;(ELFlash.java:272)
      at com.sun.faces.context.flash.ELFlash.getFlash(ELFlash.java:310)
      at com.sun.faces.context.flash.FlashFactoryImpl.getFlash(FlashFactoryImpl.java:60)
      at com.sun.faces.context.ExternalContextImpl.getFlash(ExternalContextImpl.java:1266)
      at javax.faces.context.ExternalContextWrapper.getFlash(ExternalContextWrapper.java:1034)
      at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:213)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:98)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:133)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1580)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:652)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:591)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
      at java.lang.Thread.run(Thread.java:748)
  ]]
  
  java.lang.IllegalAccessError: sun/security/provider/SunEntries
      at com.sun.crypto.provider.SunJCE.putEntries(SunJCE.java:128)
      at com.sun.crypto.provider.SunJCE.&lt;init&gt;(SunJCE.java:111)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at java.lang.Class.newInstance(Class.java:442)
      at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:221)
      at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
      at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
      at sun.security.jca.ProviderList.getProvider(ProviderList.java:233)
      at sun.security.jca.ProviderList$ServiceList.tryGet(ProviderList.java:434)
      at sun.security.jca.ProviderList$ServiceList.access$200(ProviderList.java:376)
      at sun.security.jca.ProviderList$ServiceList$1.hasNext(ProviderList.java:486)
      at javax.crypto.KeyGenerator.nextSpi(KeyGenerator.java:338)
      at javax.crypto.KeyGenerator.&lt;init&gt;(KeyGenerator.java:168)
      at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:223)
      at com.sun.faces.util.ByteArrayGuardAESCTR.setupKeyAndCharset(ByteArrayGuardAESCTR.java:192)
      at com.sun.faces.util.ByteArrayGuardAESCTR.&lt;init&gt;(ByteArrayGuardAESCTR.java:97)
      at com.sun.faces.context.flash.ELFlash.&lt;init&gt;(ELFlash.java:272)
      at com.sun.faces.context.flash.ELFlash.getFlash(ELFlash.java:310)
      at com.sun.faces.context.flash.FlashFactoryImpl.getFlash(FlashFactoryImpl.java:60)
      at com.sun.faces.context.ExternalContextImpl.getFlash(ExternalContextImpl.java:1266)
      at javax.faces.context.ExternalContextWrapper.getFlash(ExternalContextWrapper.java:1034)
      at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:213)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:98)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:133)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1580)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:652)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:591)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
      at java.lang.Thread.run(Thread.java:748)
  ]]
  </code></pre>
  <p>The projects worked fine before and still do on Eclipse right now, on the same machine and the same glassfish server.</p>
  <p>Could anybody enlighten me as to the cause of this error so I know at least how to start fixing it?
  I am using JDK 1.8 202 as a requirement if that helps.</p>
  <p>Thanks in advance.</p>