shiro web整合报错 SessionContext must be an HTTP compatible implementation

阅读更多

 

解决方案:

 

shiroFilter在web.xml的位置

移动到所有涉及的URL过滤的filter前面即可

 

Java代码   收藏代码
  1. java.lang.IllegalArgumentException: SessionContext must be an HTTP compatible implementation.  
  2.     at org.apache.shiro.web.session.mgt.ServletContainerSessionManager.createSession(ServletContainerSessionManager.java:103)  
  3.     at org.apache.shiro.web.session.mgt.ServletContainerSessionManager.start(ServletContainerSessionManager.java:64)  
  4.     at org.apache.shiro.mgt.SessionsSecurityManager.start(SessionsSecurityManager.java:121)  
  5.     at org.apache.shiro.subject.support.DelegatingSubject.getSession(DelegatingSubject.java:336)  
  6.     at org.apache.shiro.subject.support.DelegatingSubject.getSession(DelegatingSubject.java:314)  
  7.     at org.apache.shiro.mgt.DefaultSubjectDAO.mergePrincipals(DefaultSubjectDAO.java:182)  
  8.     at org.apache.shiro.mgt.DefaultSubjectDAO.saveToSession(DefaultSubjectDAO.java:163)  
  9.     at org.apache.shiro.mgt.DefaultSubjectDAO.save(DefaultSubjectDAO.java:144)  
  10.     at org.apache.shiro.mgt.DefaultSecurityManager.save(DefaultSecurityManager.java:383)  
  11.     at org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:350)  
  12.     at org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:183)  
  13.     at org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:283)  
  14.     at org.apache.shiro.subject.support.DelegatingSubject.login(DelegatingSubject.java:257)  
  15.     at com.user.action.UserAction.doLogin(UserAction.java:64)  
  16.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  17.     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
  18.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
  19.     at java.lang.reflect.Method.invoke(Unknown Source)  
  20.     at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)  
  21.     at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)  
  22.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)  
  23.     at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)  
  24.     at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)  
  25.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  26.     at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)  
  27.     at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)  
  28.     at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)  
  29.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  30.     at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)  
  31.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  32.     at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)  
  33.     at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)  
  34.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  35.     at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)  
  36.     at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)  
  37.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  38.     at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)  
  39.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  40.     at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)  
  41.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  42.     at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)  
  43.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  44.     at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)  
  45.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  46.     at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)  
  47.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  48.     at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)  
  49.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  50.     at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)  
  51.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  52.     at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)  
  53.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  54.     at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)  
  55.     at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)  
  56.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  57.     at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)  
  58.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  59.     at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)  
  60.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  61.     at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)  
  62.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  63.     at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)  
  64.     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)  
  65.     at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)  
  66.     at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)  
  67.     at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)  
  68.     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  
  69.     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
  70.     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  
  71.     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  
  72.     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)  
  73.     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  
  74.     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  
  75.     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)  
  76.     at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)  
  77.     at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)  
  78.     at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)  
  79.     at java.lang.Thread.run(Unknown Source)  

 

解决方案:

 

shiroFilter在web.xml的位置

移动到所有涉及的URL过滤的filter前面即可

你可能感兴趣的:(shiro)