shiro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lenny Primak <lpri...@hope.nyc.ny.us>
Subject Re: Session caching + Omnifaces ViewScope
Date Fri, 29 Dec 2017 18:04:56 GMT
Can you post the full stack trace?
Does this happen every time or sporadically?
My guess is the thread that’s executing isn’t correctly set up to handle session management


> On Dec 29, 2017, at 9:24 AM, Rob Young <bobbotron@gmail.com> wrote:
> 
> Hi there,
> 
> I'm trying to add distributed session management to a JSF web application.  Currently
it uses shiro 1.3.2, and pac4j to do oauth operations (plus a user/password based login option.)
 
> 
> We are heavily into using redis for other operations, so I'm trying to use this project
( https://github.com/alexxiyang/shiro-redis <https://github.com/alexxiyang/shiro-redis>
) to act as a data store for sessions.  I can see sessions getting stored in redis, but the
JSF pages throw errors related to Omnifaces.  Just curious if anyone on the list has seen
this error or had ideas for what I'm doing wrong.  I've forked the project above to convert
it to java 8.  Debugged this for a while yesterday, I can't decide where the culprit is at
the moment.
> 
> Kind regards,
> Rob
> 
> Shiro.ini
> [main]
> #redisManager
> redisManager = org.crazycake.shiro.RedisManager
> #optional if you don't specify host the default value is 127.0.0.1
> redisManager.host = dashboard-redis
> #optional , default value: 6379
> redisManager.port = 6379
> #optional, default value:0 .The expire time is in second
> #redisManager.expire = 30
> #optional, timeout for jedis try to connect to redis server(In milliseconds), not equals
to expire time! 
> redisManager.timeout = 300
> #optional, password for redis server
> # redisManager.password = 
> 
> #============redisSessionDAO=============
> redisSessionDAO = org.crazycake.shiro.RedisSessionDAO
> redisSessionDAO.keyPrefix = user:session:
> redisSessionDAO.redisManager = $redisManager
> sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
> sessionManager.sessionDAO = $redisSessionDAO
> securityManager.sessionManager = $sessionManager
> 
> #============redisCacheManager===========
> cacheManager = org.crazycake.shiro.RedisCacheManager
> cacheManager.keyPrefix = users:security:authz:
> cacheManager.redisManager = $redisManager
> #securityManager.cacheManager = $cacheManager
> 
> roleAdminAuthGenerator = xxxx
> 
> googleOidClient = org.pac4j.oidc.client.GoogleOidcClient
> googleOidClient.clientID = IDHERE
> googleOidClient.secret = SECRETHERE
> googleOidClient.useNonce = true
> googleOidClient.authorizationGenerator = $roleAdminAuthGenerator
> 
> googleCallback = com.customCallback.ABC
> 
> clients = org.pac4j.core.client.Clients
> clients.callbackUrl = $googleCallback
> clients.clients = $googleOidClient
> 
> authc = org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter
> authc.loginUrl = /login.xhtml
> user.loginUrl = /login.xhtml
> 
> requireRoleAdmin = org.pac4j.core.authorization.authorizer.RequireAnyRoleAuthorizer
> requireRoleAdmin.elements = ROLE_ADMIN
> 
> config = org.pac4j.core.config.Config
> config.clients = $clients
> config.authorizers = admin:$requireRoleAdmin
> 
> pac4jRealm = io.buji.pac4j.realm.Pac4jRealm
> cognitoRealm = com.custom.Realm
> 
> pac4jSubjectFactory = io.buji.pac4j.subject.Pac4jSubjectFactory
> securityManager.subjectFactory = $pac4jSubjectFactory
> securityManager.rememberMeManager.cipherKey = 0x22e93dafc56fd676485581753423567C
> 
> oidcSecurityFilter = io.buji.pac4j.filter.SecurityFilter
> oidcSecurityFilter.config = $config
> oidcSecurityFilter.clients = GoogleOidcClient
> 
> callbackFilter = io.buji.pac4j.filter.CallbackFilter
> callbackFilter.config = $config
> callbackFilter.multiProfile = true
> 
> Stacktrace
> =========================
> [#|2017-12-29T05:05:45.737+0000|SEVERE|glassfish 4.1|javax.enterprise.resource.webcontainer.jsf.application|_ThreadID=89;_ThreadName=http-listener-1(5);_TimeMillis=1514523945737;_LevelValue=1000;|
>   Error Rendering View[/index.xhtml]
> java.lang.NullPointerException
>     at org.jboss.weld.context.beanstore.http.AbstractSessionBeanStore.getLockStore(AbstractSessionBeanStore.java:112)
>     at org.jboss.weld.context.beanstore.AttributeBeanStore.lock(AttributeBeanStore.java:209)
>     at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:90)
>     at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:76)
>     at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101)
>     at org.jboss.weld.bean.ContextualInstanceStrategy$CachingContextualInstanceStrategy.get(ContextualInstanceStrategy.java:178)
>     at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
>     at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
>     at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125)
>     at org.omnifaces.cdi.viewscope.ViewScopeStorageInSession$Proxy$_$$_WeldClientProxy.getBeanStorageId(Unknown
Source)
>     at org.omnifaces.cdi.viewscope.ViewScopeManager.getBeanStorage(ViewScopeManager.java:174)
>     at org.omnifaces.cdi.viewscope.ViewScopeManager.getBean(ViewScopeManager.java:125)
>     at org.omnifaces.cdi.viewscope.ViewScopeManager$Proxy$_$$_WeldClientProxy.getBean(Unknown
Source)
>     at org.omnifaces.cdi.viewscope.ViewScopeContext.get(ViewScopeContext.java:67)
>     at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:70)
>     at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:96)
>     at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
>     at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:761)
>     at org.jboss.weld.el.AbstractWeldELResolver.lookup(AbstractWeldELResolver.java:107)
>     at org.jboss.weld.el.AbstractWeldELResolver.getValue(AbstractWeldELResolver.java:90)
>     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188)
>     at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
> 
> 
> -- 
> Rob Young
> robertjohnyoung@gmail.com <mailto:robertjohnyoung@gmail.com>
> 


Mime
View raw message