Caused by: java.lang.ClassCastException: com.sun.crypto.provider.AESKeyGenerator cannot be cast to javax.crypto.KeyGeneratorSpi at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:153) at org.apache.shiro.crypto.AbstractSymmetricCipherService.generateNewKey(AbstractSymmetricCipherService.java:56)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Caused by: java.lang.ClassCastException: com.sun.crypto.provider.AESKeyGenerator cannot be cast to javax.crypto.KeyGeneratorSpi at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:153) at org.apache.shiro.crypto.AbstractSymmetricCipherService.generateNewKey(AbstractSymmetricCipherService.java:56)

sumeet.tewar
This post has NOT been accepted by the mailing list yet.
Hi All,
I am new to Shiro, just downloaded Shiro Core and Web 1.3.2
and using Wildfly 10.1.0 Final for my testing.


I have configured Shiro in my web application, exactly as mentioned in this tutorial :

https://dzone.com/articles/java-security-framework-apache


But getting a ClassCastException as follows :


14:29:42,375 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 70) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./selfprovisioning: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./selfprovisioning: java.lang.RuntimeException: java.lang.ClassCastException: com.sun.crypto.provider.AESKeyGenerator cannot be cast to javax.crypto.KeyGeneratorSpi
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: com.sun.crypto.provider.AESKeyGenerator cannot be cast to javax.crypto.KeyGeneratorSpi
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:236)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
        ... 6 more
Caused by: java.lang.ClassCastException: com.sun.crypto.provider.AESKeyGenerator cannot be cast to javax.crypto.KeyGeneratorSpi
        at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:153)
        at org.apache.shiro.crypto.AbstractSymmetricCipherService.generateNewKey(AbstractSymmetricCipherService.java:56)
        at org.apache.shiro.crypto.AbstractSymmetricCipherService.generateNewKey(AbstractSymmetricCipherService.java:43)
        at org.apache.shiro.mgt.AbstractRememberMeManager.<init>(AbstractRememberMeManager.java:99)
        at org.apache.shiro.web.mgt.CookieRememberMeManager.<init>(CookieRememberMeManager.java:87)
        at org.apache.shiro.web.mgt.DefaultWebSecurityManager.<init>(DefaultWebSecurityManager.java:75)
        at org.apache.shiro.web.config.WebIniSecurityManagerFactory.createDefaultInstance(WebIniSecurityManagerFactory.java:65)
        at org.apache.shiro.config.IniSecurityManagerFactory.createDefaults(IniSecurityManagerFactory.java:152)
        at org.apache.shiro.web.config.WebIniSecurityManagerFactory.createDefaults(WebIniSecurityManagerFactory.java:71)
        at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:129)
        at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:108)
        at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:94)
        at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)
        at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
        at org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
        at org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203)
        at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99)
        at org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92)
        at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)
        at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)
        at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:221)
        at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:133)
        at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)
        at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
        at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:200)
        at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:171)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:234)
        ... 8 more

Any help would be much appreciated.