1

我一直在尝试解决我的问题一段时间,但还没有找到解决方案。几个月前,我从 Eclipse 迁移到 Intellij IDEA,并一直在 Glassfish 5 上开发 JSF/CDI Web 应用程序。现在,我最近不得不重新安装整个系统,每当我尝试部署我的 Web 应用程序时,都会收到以下错误:

exception
javax.servlet.ServletException: sun/security/provider/SunEntries

root cause
java.lang.IllegalAccessError: sun/security/provider/SunEntries

glassfish 日志显示以下内容:

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.<init>(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.<init>(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.<init>(ByteArrayGuardAESCTR.java:97)
    at com.sun.faces.context.flash.ELFlash.<init>(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.<init>(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.<init>(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.<init>(ByteArrayGuardAESCTR.java:97)
    at com.sun.faces.context.flash.ELFlash.<init>(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)
]]

这些项目以前运行良好,现在仍然在 Eclipse 上运行,在同一台机器和同一 glassfish 服务器上。

任何人都可以告诉我这个错误的原因,所以我至少知道如何开始修复它?如果有帮助,我将使用 JDK 1.8 202 作为要求。

提前致谢。

4

0 回答 0