I download the lastest source from svn and build from scratch using maven
2.0.9, deploying sample web appplication
(samples-web-1.0-incubating-SNAPSHOT) to tomcat-6.0.20. Now the exception
thrown becomes java.lang.IllegalStateException: Subject context map must
contain a javax.servlet.ServletRequest instance to support Web Subject
construction.

It looks like the servlet request does not contain in the Map `context'
where if it contains servlet the map should look like  

DefaultWebSubjectFactory.java
context:{org.apache.shiro.mgt.SubjectFactory.SERVLET_RESPONSE   
=org.apache.catalina.connector.responsefac...@28305d,
org.apache.shiro.mgt.subjectfactory.servlet_request=org.apache.shiro.web.servlet.shirohttpservletrequ...@198c6f3,
org.apache.shiro.mgt.subjectfactory.session=org.apache.shiro.session.mgt.delegatingsess...@12d8ecd}

However, the fact is that the context doesn't contain serverlet request
object:

DefaultWebSubjectFactory.java
context:{org.apache.shiro.mgt.SubjectFactory.AUTHENTICATION_TOKEN=org.apach   
e.shiro.authc.UsernamePasswordToken - lonestarr, rememberMe=false
(/0:0:0:0:0:0:0:1),
org.apache.shiro.mgt.subjectfactory.authentication_info=org.apache.shiro.subject.simpleprincipalcollect...@2be4d84a,
org.apache.shiro.mgt.SubjectFactory.AUTHENTICATED=true,
org.apache.shiro.mgt.subjectfactory.subject=org.apache.shiro.web.subject.webdelegatingsubj...@497062}

So it goes wrong (stacktrace is as below). Is there any possibility may
cause such problem? I appreciate any help. Thank you very much. 


exception

javax.servlet.ServletException: Filter execution resulted in an unexpected
Exception (not IOException or ServletException as the Filter api
recommends).  Wrapping in ServletException and propagating.
        org.apache.shiro.web.servlet.AdviceFilter.cleanup(AdviceFilter.java:205)

org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:159)

org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:191)

org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:65)
        
org.apache.shiro.web.servlet.ShiroFilter.executeChain(ShiroFilter.java:648)

org.apache.shiro.web.servlet.ShiroFilter.doFilterInternal(ShiroFilter.java:585)

org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:191)

root cause

java.lang.IllegalStateException: Subject context map must contain a
javax.servlet.ServletRequest instance to support Web Subject construction.

org.apache.shiro.web.mgt.DefaultWebSubjectFactory.getServletRequest(DefaultWebSubjectFactory.java:42)

org.apache.shiro.web.mgt.DefaultWebSubjectFactory.createSubject(DefaultWebSubjectFactory.java:73)

org.apache.shiro.mgt.DefaultSecurityManager.getSubject(DefaultSecurityManager.java:404)

org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:274)

org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:370)

org.apache.shiro.subject.DelegatingSubject.login(DelegatingSubject.java:245)

org.apache.shiro.web.filter.authc.AuthenticatingFilter.executeLogin(AuthenticatingFilter.java:51)

org.apache.shiro.web.filter.authc.FormAuthenticationFilter.onAccessDenied(FormAuthenticationFilter.java:152)

org.apache.shiro.web.filter.AccessControlFilter.onAccessDenied(AccessControlFilter.java:135)

org.apache.shiro.web.filter.AccessControlFilter.onPreHandle(AccessControlFilter.java:164)

org.apache.shiro.web.filter.PathMatchingFilter.preHandle(PathMatchingFilter.java:179)

org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:133)

org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:191)

org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:65)
        
org.apache.shiro.web.servlet.ShiroFilter.executeChain(ShiroFilter.java:648)

org.apache.shiro.web.servlet.ShiroFilter.doFilterInternal(ShiroFilter.java:585)

org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:191)


-- 
View this message in context: 
http://n2.nabble.com/IllegalStateException-Subject-context-map-must-contain-a-javax-servlet-ServletRequest-instance-to-su-tp3511027p3511027.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to