You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Tauren Mills <ta...@tauren.com> on 2010/05/13 12:24:50 UTC
Deprecated classes and wicket integration
Les,
Shiro was integrated into my wicket application almost a year ago, so it is
using deprecated methods and classes. I'd like to get it updated so that it
will run on Shiro 1.0. I'd also like to get it using native sessions.
The application uses the wicket-shiro integration:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/shiro-security/
The code in this example is very similar to how my application is currently
configured:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/shiro-security/wicket-shiro-examples/shiro-example-spring-hibernate/
I created a new example for spring-hibernate-native sessions and have been
trying to get it configured to work without using any deprecated classes and
with native sessions. I committed my efforts so far here:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/shiro-security/wicket-shiro-examples/shiro-example-spring-hibernate-native/
I'm unsure the best way to proceed. All the latest shiro docs and examples
show filters and filterChainDefinitions being configured for ShiroFilter in
the spring xml file. But I'd like to continue using the following
annotation in my MemberPage:
@ShiroSecurityConstraint(
constraint = ShiroConstraint.HasRole,
value = "member",
loginMessage = "You must be member to view this page",
unauthorizedMessage = "You need to be a member"
)
As well as the following code in application (run during application
initialization, setting LoginPage and UnauthorizedPage):
SecurityUtils.setSecurityManager(securityManager);
AnnotationsShiroAuthorizationStrategy authz = new
AnnotationsShiroAuthorizationStrategy();
getSecuritySettings().setAuthorizationStrategy(authz);
getSecuritySettings().setUnauthorizedComponentInstantiationListener(
new ShiroUnauthorizedComponentListener(LoginPage.class,
UnauthorizedPage.class, authz));
The shiro-example-spring-hibernate-native example is easy to checkout and
get running. When I run it, I get exceptions and lots of warnings. See below
for a stack trace. I am thinking that a lot of the features of wicket-shiro
may no longer be all that useful and might just be complicating things.
Would love to hear your thoughts on this.
I'd really appreciate it if you could look over this example app and give me
some pointers on how to proceed. My plan is to get the entire wicket-shiro
project updated to work with Shiro 1.0. Once a non-snapshot pom is available
for shiro, the project can be included in wicketstuff-core. This might help
improve shiro adoption by wicket users.
Thanks,
Tauren
----
2010-05-13 02:06:06,136 INFO [org.mortbay.log] - Started
SocketConnector@0.0.0.0:8080
2010-05-13 02:06:14,740 TRACE
[org.apache.shiro.web.servlet.OncePerRequestFilter] - Filter 'null' not yet
executed. Executing now.
2010-05-13 02:06:14,754 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- Context already contains a SecurityManager instance. Returning.
2010-05-13 02:06:14,754 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No session found in context. Looking for a session id to resolve in to a
session.
2010-05-13 02:06:14,754 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Found string value [c0c84acd-ed96-4a6b-a363-66067ace2ddb] from Cookie
[JSESSIONID]
2010-05-13 02:06:14,754 DEBUG
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - No
sessionValidationScheduler set. Attempting to create default instance.
2010-05-13 02:06:14,755 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Created
default SessionValidationScheduler instance of type
[org.apache.shiro.session.mgt.ExecutorServiceSessionValidationScheduler].
2010-05-13 02:06:14,755 INFO
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Enabling
session validation scheduler...
2010-05-13 02:06:14,763 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [c0c84acd-ed96-4a6b-a363-66067ace2ddb]
2010-05-13 02:06:14,763 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-13 02:06:14,764 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed cookie[JSESSIONID] with path [/] from HttpServletResponse.
2010-05-13 02:06:14,764 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-13 02:06:14,765 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed cookie[rememberMe] with path [/] from HttpServletResponse.
2010-05-13 02:06:14,765 DEBUG [org.apache.shiro.mgt.DefaultSecurityManager]
- Referenced sessionId c0c84acd-ed96-4a6b-a363-66067ace2ddb is invalid.
Ignoring and creating an anonymous (session-less) Subject instance.
2010-05-13 02:06:14,766 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- Exception resulting from invalid referenced sessionId
c0c84acd-ed96-4a6b-a363-66067ace2ddb
org.apache.shiro.session.UnknownSessionException: There is no session with
id [c0c84acd-ed96-4a6b-a363-66067ace2ddb]
at
org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:171)
at
org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:221)
at
org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:217)
at
org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:123)
at
org.apache.shiro.session.mgt.AbstractSessionManager.getSession(AbstractSessionManager.java:246)
at
org.apache.shiro.session.mgt.AbstractSessionManager.checkValid(AbstractSessionManager.java:265)
at
org.apache.shiro.mgt.SessionsSecurityManager.checkValid(SessionsSecurityManager.java:145)
at
org.apache.shiro.mgt.DefaultSecurityManager.getSession(DefaultSecurityManager.java:126)
at
org.apache.shiro.mgt.DefaultSecurityManager.resolveSession(DefaultSecurityManager.java:369)
at
org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:316)
at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:767)
at
org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:101)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.bind(AbstractShiroFilter.java:215)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:302)
at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
2010-05-13 02:06:14,767 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No identity (PrincipalCollection) found in the context. Looking for a
remembered identity.
2010-05-13 02:06:14,767 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Found string value [deleteMe] from Cookie [rememberMe]
2010-05-13 02:06:14,767 TRACE
[org.apache.shiro.web.mgt.CookieRememberMeManager] - Acquired Base64 encoded
identity [deleteMe]
2010-05-13 02:06:14,767 TRACE
[org.apache.shiro.web.mgt.CookieRememberMeManager] - Base64 decoded byte
array length: 6 bytes.
2010-05-13 02:06:14,768 DEBUG
[org.apache.shiro.mgt.AbstractRememberMeManager] - There was a failure while
trying to retrieve remembered principals. This could be due to a
configuration problem or corrupted principals. This could also be due to a
recently changed encryption key. The remembered identity will be forgotten
and not used for this request.
org.apache.shiro.crypto.CryptoException: Unable to correctly extract the
Initialization Vector or ciphertext.
at
org.apache.shiro.crypto.JcaCipherService.decrypt(JcaCipherService.java:381)
at
org.apache.shiro.mgt.AbstractRememberMeManager.decrypt(AbstractRememberMeManager.java:491)
at
org.apache.shiro.mgt.AbstractRememberMeManager.convertBytesToPrincipals(AbstractRememberMeManager.java:431)
at
org.apache.shiro.mgt.AbstractRememberMeManager.getRememberedPrincipals(AbstractRememberMeManager.java:398)
at
org.apache.shiro.mgt.DefaultSecurityManager.getRememberedIdentity(DefaultSecurityManager.java:526)
at
org.apache.shiro.mgt.DefaultSecurityManager.resolvePrincipals(DefaultSecurityManager.java:403)
at
org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:320)
at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:767)
at
org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:101)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.bind(AbstractShiroFilter.java:215)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:302)
at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
org.apache.shiro.crypto.JcaCipherService.decrypt(JcaCipherService.java:373)
... 28 more
2010-05-13 02:06:14,768 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-13 02:06:14,768 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed cookie[rememberMe] with path [/] from HttpServletResponse.
2010-05-13 02:06:14,768 WARN [org.apache.shiro.mgt.DefaultSecurityManager] -
Delegate RememberMeManager instance of type
[org.apache.shiro.web.mgt.CookieRememberMeManager] threw an exception during
getRememberedPrincipals().
org.apache.shiro.crypto.CryptoException: Unable to correctly extract the
Initialization Vector or ciphertext.
at
org.apache.shiro.crypto.JcaCipherService.decrypt(JcaCipherService.java:381)
at
org.apache.shiro.mgt.AbstractRememberMeManager.decrypt(AbstractRememberMeManager.java:491)
at
org.apache.shiro.mgt.AbstractRememberMeManager.convertBytesToPrincipals(AbstractRememberMeManager.java:431)
at
org.apache.shiro.mgt.AbstractRememberMeManager.getRememberedPrincipals(AbstractRememberMeManager.java:398)
at
org.apache.shiro.mgt.DefaultSecurityManager.getRememberedIdentity(DefaultSecurityManager.java:526)
at
org.apache.shiro.mgt.DefaultSecurityManager.resolvePrincipals(DefaultSecurityManager.java:403)
at
org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:320)
at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:767)
at
org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:101)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.bind(AbstractShiroFilter.java:215)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:302)
at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
org.apache.shiro.crypto.JcaCipherService.decrypt(JcaCipherService.java:373)
... 28 more
2010-05-13 02:06:14,769 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No remembered identity found. Returning original context.
2010-05-13 02:06:14,775 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,775 TRACE
[org.apache.shiro.web.servlet.AbstractShiroFilter] - No FilterChain
configured for the current request. Using the default.
2010-05-13 02:06:14,777 TRACE
[org.apache.shiro.web.servlet.OncePerRequestFilter] - Filter 'null' already
executed. Proceeding without invoking this filter.
2010-05-13 02:06:14,780 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,780 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,791 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,791 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,818 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,818 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,819 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,819 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,819 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,819 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,900 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,900 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,978 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:14,978 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,006 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,006 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,008 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,008 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,008 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,008 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,009 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,009 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,009 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,009 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-13 02:06:15,022 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = true; session is null = true; session has id = false
2010-05-13 02:06:15,022 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - Starting session for
host 127.0.0.1
2010-05-13 02:06:15,024 TRACE
[org.apache.shiro.session.mgt.DefaultSessionManager] - Creating session for
host 127.0.0.1
2010-05-13 02:06:15,024 DEBUG
[org.apache.shiro.session.mgt.DefaultSessionManager] - Creating new EIS
record for new session instance
[org.apache.shiro.session.mgt.SimpleSession,id=null]
2010-05-13 02:06:15,025 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-13 02:06:15,025 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Added Cookie [JSESSIONID] to path [/] with value
[de7888ea-217e-4bd8-9fb0-1d7893ade5c4] to the HttpServletResponse
2010-05-13 02:06:15,025 TRACE
[org.apache.shiro.web.session.DefaultWebSessionManager] - Set session ID
cookie for session with id de7888ea-217e-4bd8-9fb0-1d7893ade5c4
2010-05-13 02:06:15,034 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-13 02:06:15,034 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-13 02:06:15,037 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,038 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,039 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,039 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,069 TRACE
[org.apache.shiro.web.servlet.OncePerRequestFilter] - Filter 'null' not yet
executed. Executing now.
2010-05-13 02:06:15,069 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- Context already contains a SecurityManager instance. Returning.
2010-05-13 02:06:15,069 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No session found in context. Looking for a session id to resolve in to a
session.
2010-05-13 02:06:15,069 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Found string value [de7888ea-217e-4bd8-9fb0-1d7893ade5c4] from Cookie
[JSESSIONID]
2010-05-13 02:06:15,069 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,069 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,069 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No identity (PrincipalCollection) found in the context. Looking for a
remembered identity.
2010-05-13 02:06:15,069 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
No value found in request Cookies under cookie name [rememberMe]
2010-05-13 02:06:15,069 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No remembered identity found. Returning original context.
2010-05-13 02:06:15,069 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,069 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,069 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,069 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,070 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-13 02:06:15,070 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,070 TRACE
[org.apache.shiro.web.servlet.AbstractShiroFilter] - No FilterChain
configured for the current request. Using the default.
2010-05-13 02:06:15,070 TRACE
[org.apache.shiro.web.servlet.OncePerRequestFilter] - Filter 'null' already
executed. Proceeding without invoking this filter.
2010-05-13 02:06:15,070 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-13 02:06:15,070 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-13 02:06:15,070 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,094 TRACE
[org.apache.shiro.web.servlet.OncePerRequestFilter] - Filter 'null' not yet
executed. Executing now.
2010-05-13 02:06:15,095 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- Context already contains a SecurityManager instance. Returning.
2010-05-13 02:06:15,095 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No session found in context. Looking for a session id to resolve in to a
session.
2010-05-13 02:06:15,095 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Found string value [de7888ea-217e-4bd8-9fb0-1d7893ade5c4] from Cookie
[JSESSIONID]
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,095 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No identity (PrincipalCollection) found in the context. Looking for a
remembered identity.
2010-05-13 02:06:15,095 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
No value found in request Cookies under cookie name [rememberMe]
2010-05-13 02:06:15,095 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No remembered identity found. Returning original context.
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [de7888ea-217e-4bd8-9fb0-1d7893ade5c4]
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.web.servlet.AbstractShiroFilter] - No FilterChain
configured for the current request. Using the default.
2010-05-13 02:06:15,095 TRACE
[org.apache.shiro.web.servlet.OncePerRequestFilter] - Filter 'null' already
executed. Proceeding without invoking this filter.
Re: Deprecated classes and wicket integration
Posted by Tauren Mills <ta...@tauren.com>.
Les,
I've grabbed the latest snapshot and tried it out, but I think there is
still something wrong with cookies. Were you able to get this example to
run properly with the latest shiro code?
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/shiro-security/wicket-shiro-examples/shiro-example-spring-hibernate-native/
I'm getting an exception when I log out. See below.
Also, in my real application, I'm getting strange behavior with the
following code:
SecurityUtils.getSubject().getPrincipal();
About half the time, it returns null. The rest of the time it returns a
valid currently logged in user. Here's some logs when it returns null:
TRACE - DefaultSecurityManager - Context already contains a
SecurityManager instance. Returning.
TRACE - DefaultSecurityManager - No session found in context. Looking
for a session id to resolve in to a session.
TRACE - DefaultSecurityManager - No identity (PrincipalCollection) found
in the context. Looking for a remembered identity.
DEBUG - CookieRememberMeManager - SubjectContext argument is not an
HTTP-aware instance. This is required to obtain a servlet request and
response in order to retrieve the rememberMe cookie. Returning immediately
and ignoring rememberMe operation.
TRACE - DefaultSecurityManager - No remembered identity found.
Returning original context.
Here is the exception on logout in the sample app:
2010-05-15 02:28:59,608 INFO [org.wicketstuff.shiro.page.LogoutPage] -
logout: org.apache.shiro.web.subject.support.WebDelegatingSubject@780eb73e
2010-05-15 02:28:59,608 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-15 02:28:59,608 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,609 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-15 02:28:59,609 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Added HttpServletResponse Cookie [rememberMe=deleteMe; Path=/; Expires=Fri,
14-May-2010 09:28:59 GMT]
2010-05-15 02:28:59,609 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed 'rememberMe' cookie by setting maxAge=0
2010-05-15 02:28:59,609 DEBUG [org.apache.shiro.mgt.DefaultSecurityManager]
- Logging out subject with primary principal {}1
2010-05-15 02:28:59,609 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-15 02:28:59,609 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,609 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,609 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = false; session has id = true
2010-05-15 02:28:59,609 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,609 DEBUG
[org.apache.shiro.session.mgt.AbstractSessionManager] - Stopping session
with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,609 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-15 02:28:59,609 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Added HttpServletResponse Cookie [JSESSIONID=deleteMe; Path=/; Expires=Fri,
14-May-2010 09:28:59 GMT]
2010-05-15 02:28:59,609 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed 'JSESSIONID' cookie by setting maxAge=0
2010-05-15 02:28:59,609 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,610 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-15 02:28:59,610 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Added HttpServletResponse Cookie [JSESSIONID=deleteMe; Path=/; Expires=Fri,
14-May-2010 09:28:59 GMT]
2010-05-15 02:28:59,610 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed 'JSESSIONID' cookie by setting maxAge=0
2010-05-15 02:28:59,610 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,610 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-15 02:28:59,610 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Added HttpServletResponse Cookie [JSESSIONID=deleteMe; Path=/; Expires=Fri,
14-May-2010 09:28:59 GMT]
2010-05-15 02:28:59,610 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed 'JSESSIONID' cookie by setting maxAge=0
2010-05-15 02:28:59,610 ERROR [org.apache.wicket.RequestCycle] - Can't
instantiate page using constructor public
org.wicketstuff.shiro.example.pages.IndexPage()
org.apache.wicket.WicketRuntimeException: Can't instantiate page using
constructor public org.wicketstuff.shiro.example.pages.IndexPage()
at
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:299)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:321)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:262)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:376)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:309)
at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)
... 39 more
Caused by: java.lang.IllegalStateException:
org.apache.shiro.session.UnknownSessionException: There is no session with
id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
at
org.apache.shiro.web.servlet.ShiroHttpSession.getAttribute(ShiroHttpSession.java:133)
at
org.apache.wicket.protocol.http.HttpSessionStore.getAttribute(HttpSessionStore.java:69)
at org.apache.wicket.Session.getAttribute(Session.java:1197)
at org.apache.wicket.Session.pageMapForName(Session.java:955)
at org.apache.wicket.PageMap.forName(PageMap.java:80)
at org.apache.wicket.Page.init(Page.java:1215)
at org.apache.wicket.Page.<init>(Page.java:238)
at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:185)
at org.wicketstuff.shiro.example.pages.BasePage.<init>(BasePage.java:18)
at org.wicketstuff.shiro.example.pages.IndexPage.<init>(IndexPage.java:12)
... 44 more
Caused by: org.apache.shiro.session.UnknownSessionException: There is no
session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
at
org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:171)
at
org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:221)
at
org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:217)
at
org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:123)
at
org.apache.shiro.session.mgt.AbstractSessionManager.getSession(AbstractSessionManager.java:246)
at
org.apache.shiro.session.mgt.AbstractSessionManager.getAttribute(AbstractSessionManager.java:220)
at
org.apache.shiro.mgt.SessionsSecurityManager.getAttribute(SessionsSecurityManager.java:173)
at
org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:188)
at
org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:122)
at
org.apache.shiro.web.servlet.ShiroHttpSession.getAttribute(ShiroHttpSession.java:131)
... 53 more
2010-05-15 02:28:59,612 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,612 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-15 02:28:59,612 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Added HttpServletResponse Cookie [JSESSIONID=deleteMe; Path=/; Expires=Fri,
14-May-2010 09:28:59 GMT]
2010-05-15 02:28:59,612 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed 'JSESSIONID' cookie by setting maxAge=0
2010-05-15 02:28:59,612 TRACE
[org.apache.shiro.session.mgt.AbstractValidatingSessionManager] - Attempting
to retrieve session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
2010-05-15 02:28:59,612 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
calculated path: /
2010-05-15 02:28:59,612 DEBUG [org.apache.shiro.web.servlet.SimpleCookie] -
Added HttpServletResponse Cookie [JSESSIONID=deleteMe; Path=/; Expires=Fri,
14-May-2010 09:28:59 GMT]
2010-05-15 02:28:59,612 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
Removed 'JSESSIONID' cookie by setting maxAge=0
2010-05-15 02:28:59,613 ERROR [org.mortbay.log] - /account/logout
java.lang.IllegalStateException:
org.apache.shiro.session.UnknownSessionException: There is no session with
id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
at
org.apache.shiro.web.servlet.ShiroHttpSession.getAttribute(ShiroHttpSession.java:133)
at
org.apache.wicket.protocol.http.HttpSessionStore.getAttribute(HttpSessionStore.java:69)
at org.apache.wicket.Session.getAttribute(Session.java:1197)
at org.apache.wicket.Session.pageMapForName(Session.java:955)
at org.apache.wicket.PageMap.forName(PageMap.java:80)
at org.apache.wicket.Page.init(Page.java:1215)
at org.apache.wicket.Page.<init>(Page.java:238)
at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:185)
at
org.apache.wicket.markup.html.pages.ExceptionErrorPage.<init>(ExceptionErrorPage.java:55)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:169)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1379)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:376)
at
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:309)
at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: org.apache.shiro.session.UnknownSessionException: There is no
session with id [1aaa6687-6874-4c74-ba24-b74b491e9a8a]
at
org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:171)
at
org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:221)
at
org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:217)
at
org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:123)
at
org.apache.shiro.session.mgt.AbstractSessionManager.getSession(AbstractSessionManager.java:246)
at
org.apache.shiro.session.mgt.AbstractSessionManager.getAttribute(AbstractSessionManager.java:220)
at
org.apache.shiro.mgt.SessionsSecurityManager.getAttribute(SessionsSecurityManager.java:173)
at
org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:188)
at
org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:122)
at
org.apache.shiro.web.servlet.ShiroHttpSession.getAttribute(ShiroHttpSession.java:131)
... 42 more
2010-05-15 02:28:59,653 TRACE
[org.apache.shiro.web.servlet.OncePerRequestFilter] - Filter 'null' not yet
executed. Executing now.
2010-05-15 02:28:59,653 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- Context already contains a SecurityManager instance. Returning.
2010-05-15 02:28:59,653 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No session found in context. Looking for a session id to resolve in to a
session.
2010-05-15 02:28:59,653 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
No value found in request Cookies under cookie name [JSESSIONID]
2010-05-15 02:28:59,653 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No identity (PrincipalCollection) found in the context. Looking for a
remembered identity.
2010-05-15 02:28:59,653 TRACE [org.apache.shiro.web.servlet.SimpleCookie] -
No value found in request Cookies under cookie name [rememberMe]
2010-05-15 02:28:59,653 TRACE [org.apache.shiro.mgt.DefaultSecurityManager]
- No remembered identity found. Returning original context.
2010-05-15 02:28:59,654 TRACE
[org.apache.shiro.subject.support.DelegatingSubject] - attempting to get
session; create = false; session is null = true; session has id = false
2010-05-15 02:28:59,654 TRACE
[org.apache.shiro.web.servlet.AbstractShiroFilter] - No FilterChain
configured for the current request. Using the default.
2010-05-15 02:28:59,654 TRACE
[org.apache.shiro.web.servlet.OncePerRequestFilter] - Filter 'null' already
executed. Proceeding without invoking this filter.
Re: Deprecated classes and wicket integration
Posted by Les Hazlewood <lh...@apache.org>.
They're created as soon as Apache's Hudson gets around to building
them. It triggers a build any time someone commits source code, but
the Hudson server can be quite bogged down sometimes - it could be
anywhere from 5 minutes to a couple hours after a commit when it is
actually built.
Generally within a few hours, I think you'll be pretty safe. If you
want to try new stuff any faster, you should maintain your own trunk
copy.
HTH,
Les
On Fri, May 14, 2010 at 3:35 AM, Tauren Mills <ta...@tauren.com> wrote:
> Les,
> Thanks for tracking this down! I'll give the new version a try.
> Just curious -- how often are maven snapshots created from trunk, and does
> it happen at a certain time of the day? If I update to the latest snapshot,
> would these changes be in it? Or should I just checkout trunk and mvn
> install?
> Thanks,
> Tauren
>
> On Fri, May 14, 2010 at 2:30 AM, Les Hazlewood <lh...@apache.org>
> wrote:
>>
>> Hi Tauren,
>>
>> This is extremely odd. The key to these messages is here:
>>
>> 2010-05-13 02:06:14,767 DEBUG
>> [org.apache.shiro.web.servlet.SimpleCookie] - Found string value
>> [deleteMe] from Cookie [rememberMe]
>> 2010-05-13 02:06:14,767 TRACE
>> [org.apache.shiro.web.mgt.CookieRememberMeManager] - Acquired Base64
>> encoded identity [deleteMe]
>>
>> Basically the SimpleCookie implementation did this to delete a cookie
>> (deleting a cookie is just setting a cookie with a maxAge=0):
>>
>> - get the 'rememberMe' javax.servlet.http.Cookie instance from the
>> incoming request
>> - use that same exact instance to set the maxAge=0 and change the
>> value to 'delete' me
>> - take that same instance and call response.addCookie to ensure the
>> cookie was deleted on the outgoing response.
>>
>> Apparently however, that instance is not its own copy in some
>> implementations (Wicket? Tomcat? who knows). So when we were setting
>> that value on the request cookie to use on the outgoing response, we
>> were overwriting the cookie value that apparently was trying to be
>> read later on by the CookieRememberMeManager. Nasty stuff ;)
>>
>> So, I updated the cookie implementation to always write out 'fresh'
>> (not shared) data to the response headers. I updated SHIRO-139 [1] to
>> reflect this. It is all committed. Please try it out.
>>
>> All the exceptions in the stack trace you pasted was related to this.
>> It should be all good to go now.
>>
>> Best,
>>
>> Les
>>
>> [1] https://issues.apache.org/jira/browse/SHIRO-139
>
>
Re: Deprecated classes and wicket integration
Posted by Tauren Mills <ta...@tauren.com>.
Les,
Thanks for tracking this down! I'll give the new version a try.
Just curious -- how often are maven snapshots created from trunk, and does
it happen at a certain time of the day? If I update to the latest snapshot,
would these changes be in it? Or should I just checkout trunk and mvn
install?
Thanks,
Tauren
On Fri, May 14, 2010 at 2:30 AM, Les Hazlewood <lh...@apache.org>wrote:
> Hi Tauren,
>
> This is extremely odd. The key to these messages is here:
>
> 2010-05-13 02:06:14,767 DEBUG
> [org.apache.shiro.web.servlet.SimpleCookie] - Found string value
> [deleteMe] from Cookie [rememberMe]
> 2010-05-13 02:06:14,767 TRACE
> [org.apache.shiro.web.mgt.CookieRememberMeManager] - Acquired Base64
> encoded identity [deleteMe]
>
> Basically the SimpleCookie implementation did this to delete a cookie
> (deleting a cookie is just setting a cookie with a maxAge=0):
>
> - get the 'rememberMe' javax.servlet.http.Cookie instance from the
> incoming request
> - use that same exact instance to set the maxAge=0 and change the
> value to 'delete' me
> - take that same instance and call response.addCookie to ensure the
> cookie was deleted on the outgoing response.
>
> Apparently however, that instance is not its own copy in some
> implementations (Wicket? Tomcat? who knows). So when we were setting
> that value on the request cookie to use on the outgoing response, we
> were overwriting the cookie value that apparently was trying to be
> read later on by the CookieRememberMeManager. Nasty stuff ;)
>
> So, I updated the cookie implementation to always write out 'fresh'
> (not shared) data to the response headers. I updated SHIRO-139 [1] to
> reflect this. It is all committed. Please try it out.
>
> All the exceptions in the stack trace you pasted was related to this.
> It should be all good to go now.
>
> Best,
>
> Les
>
> [1] https://issues.apache.org/jira/browse/SHIRO-139
>
Re: Deprecated classes and wicket integration
Posted by Les Hazlewood <lh...@apache.org>.
Hi Tauren,
This is extremely odd. The key to these messages is here:
2010-05-13 02:06:14,767 DEBUG
[org.apache.shiro.web.servlet.SimpleCookie] - Found string value
[deleteMe] from Cookie [rememberMe]
2010-05-13 02:06:14,767 TRACE
[org.apache.shiro.web.mgt.CookieRememberMeManager] - Acquired Base64
encoded identity [deleteMe]
Basically the SimpleCookie implementation did this to delete a cookie
(deleting a cookie is just setting a cookie with a maxAge=0):
- get the 'rememberMe' javax.servlet.http.Cookie instance from the
incoming request
- use that same exact instance to set the maxAge=0 and change the
value to 'delete' me
- take that same instance and call response.addCookie to ensure the
cookie was deleted on the outgoing response.
Apparently however, that instance is not its own copy in some
implementations (Wicket? Tomcat? who knows). So when we were setting
that value on the request cookie to use on the outgoing response, we
were overwriting the cookie value that apparently was trying to be
read later on by the CookieRememberMeManager. Nasty stuff ;)
So, I updated the cookie implementation to always write out 'fresh'
(not shared) data to the response headers. I updated SHIRO-139 [1] to
reflect this. It is all committed. Please try it out.
All the exceptions in the stack trace you pasted was related to this.
It should be all good to go now.
Best,
Les
[1] https://issues.apache.org/jira/browse/SHIRO-139