Shiro.There没有id会话

时间:2014-05-20 19:42:49

标签: session gwt shiro subject

我正在使用shiro-1.2.3 for GWT webapp。我能够配置用户的登录过程;但是,我需要一些关于shiro注销过程的帮助。 webapp是通过tomcat部署的,它为不同的用户创建了新的实例。因此,例如,当两个用户登录时,shiro创建了两个会话ID;但是,当我点击退出按钮时,它会调用subject.logout()函数来注销用户,看起来Shiro只跟踪一个会话(最后一个用户登录),出于某种原因。如果只有一个用户登录,它将成功注销;但是,当注销多个时,这就是我得到的:

  

引起:org.apache.shiro.session.UnknownSessionException:没有id为[f5b7c3bf-2c53-40e9-a707-37f4265970aa]的会话       在org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:170)       在org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236)       在org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222)       at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118)       at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:105)       at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:109)       在org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:206)       at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141)       在org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121)       在org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121)       在org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121)       在com.factorlab.security.FactorlabDelegatingSubject.getUser(FactorlabDelegatingSubject.java:34)       在com.factorlab.security.FactorlabDelegatingSubject.getUser(FactorlabDelegatingSubject.java:10)       at com.factorlab.persistence.AbstractEntityDao.getCurrentUser(AbstractEntityDao.java:227)       at com.factorlab.persistence.AbstractEntityDao.fireEvent(AbstractEntityDao.java:215)       at com.factorlab.persistence.AbstractEntityDao.saveOrUpdate(AbstractEntityDao.java:190)       at com.factorlab.persistence.AbstractEntityDao.saveOrUpdate(AbstractEntityDao.java:177)       at com.factorlab.persistence.AbstractEntityDao.saveOrUpdate(AbstractEntityDao.java:38)       at sun.reflect.GeneratedMethodAccessor106.invoke(未知来源)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       在java.lang.reflect.Method.invoke(Method.java:616)       在org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)       在org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)       在$ Proxy72.saveOrUpdate(未知来源)       at com.factorlab.observations.sales.OpportunityScoreUpdateServiceImpl.receiveOpportunityEvent(OpportunityScoreUpdateServiceImpl.java:83)       at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       在java.lang.reflect.Method.invoke(Method.java:616)       在org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)       在org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)       在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)       在org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)       在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)       在org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)       在$ Proxy76.receiveOpportunityEvent(未知来源)       at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       在java.lang.reflect.Method.invoke(Method.java:616)       在org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:69)       在org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:84)       在org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)       在org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)       在org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:102)       在org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:126)       在org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:227)       在org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:127)       在org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:73)       ......还有49个

**Shiro.ini**
[main]
myRealm=com.java.gwt.server.auth.MyRealm
myCacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $myCacheManager 
securityManager.sessionManager.globalSessionTimeout = 9000000

我也尝试过使用EhCache管理器。

登录时,我使用的是shiro的10分钟教程中显示的相同信息。

感谢您的时间。

0 个答案:

没有答案