当前位置:   article > 正文

shiro1.4.0升级为1.10.0方案_shiro升级

shiro升级

因为接手的之前项目,项目shiro版本比较老,13个jar包都是1.4.0的:

 最近护网行动期间项目被扫描有漏洞,所以要把shiro升级到1.9.1以上版本。于是我选了1.10.0,结果升级完后项目启动没问题,登录管理台报错:

  1. 2023-08-14 16:36:38.925 ERROR 500.jsp[148] - Filtered request failed.
  2. javax.servlet.ServletException: Filtered request failed.
  3. at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:392) ~[shiro-web-1.10.0.jar:1.10.0]
  4. at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154) ~[shiro-web-1.10.0.jar:1.10.0]
  5. at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
  6. at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
  7. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.44]
  8. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.44]
  9. at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
  10. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
  11. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.44]
  12. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.44]
  13. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[catalina.jar:9.0.44]
  14. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[catalina.jar:9.0.44]
  15. at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[catalina.jar:9.0.44]
  16. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[catalina.jar:9.0.44]
  17. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.44]
  18. at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687) [catalina.jar:9.0.44]
  19. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [catalina.jar:9.0.44]
  20. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) [catalina.jar:9.0.44]
  21. at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) [tomcat-coyote.jar:9.0.44]
  22. at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.44]
  23. at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) [tomcat-coyote.jar:9.0.44]
  24. at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) [tomcat-coyote.jar:9.0.44]
  25. at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.44]
  26. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_231]
  27. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_231]
  28. at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.44]
  29. at java.lang.Thread.run(Thread.java:748) [na:1.8.0_231]
  30. Caused by: java.lang.NoClassDefFoundError: org/owasp/encoder/Encode
  31. at org.apache.shiro.web.servlet.SimpleCookie.readValue(SimpleCookie.java:447) ~[shiro-web-1.10.0.jar:1.10.0]
  32. at org.apache.shiro.web.session.mgt.DefaultWebSessionManager.getSessionIdCookieValue(DefaultWebSessionManager.java:118) ~[shiro-web-1.10.0.jar:1.10.0]
  33. at org.apache.shiro.web.session.mgt.DefaultWebSessionManager.getReferencedSessionId(DefaultWebSessionManager.java:123) ~[shiro-web-1.10.0.jar:1.10.0]
  34. at org.apache.shiro.web.session.mgt.DefaultWebSessionManager.getSessionId(DefaultWebSessionManager.java:283) ~[shiro-web-1.10.0.jar:1.10.0]
  35. at com.ofsp.common.security.shiro.session.SessionManager.getSessionId(SessionManager.java:59) ~[ofsp-model-1.2.jar:na]
  36. at org.apache.shiro.web.session.mgt.DefaultWebSessionManager.getSessionId(DefaultWebSessionManager.java:277) ~[shiro-web-1.10.0.jar:1.10.0]
  37. at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:216) ~[shiro-core-1.10.0.jar:1.10.0]
  38. at com.ofsp.common.security.shiro.session.SessionManager.retrieveSession(SessionManager.java:70) ~[ofsp-model-1.2.jar:na]
  39. at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118) ~[shiro-core-1.10.0.jar:1.10.0]
  40. at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:148) ~[shiro-core-1.10.0.jar:1.10.0]
  41. at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getSession(AbstractNativeSessionManager.java:140) ~[shiro-core-1.10.0.jar:1.10.0]
  42. at org.apache.shiro.mgt.SessionsSecurityManager.getSession(SessionsSecurityManager.java:159) ~[shiro-core-1.10.0.jar:1.10.0]
  43. at org.apache.shiro.mgt.DefaultSecurityManager.resolveContextSession(DefaultSecurityManager.java:461) ~[shiro-core-1.10.0.jar:1.10.0]
  44. at org.apache.shiro.mgt.DefaultSecurityManager.resolveSession(DefaultSecurityManager.java:447) ~[shiro-core-1.10.0.jar:1.10.0]
  45. at org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:343) ~[shiro-core-1.10.0.jar:1.10.0]
  46. at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:845) ~[shiro-core-1.10.0.jar:1.10.0]
  47. at org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:148) ~[shiro-web-1.10.0.jar:1.10.0]
  48. at org.apache.shiro.web.servlet.AbstractShiroFilter.createSubject(AbstractShiroFilter.java:300) ~[shiro-web-1.10.0.jar:1.10.0]
  49. at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:367) ~[shiro-web-1.10.0.jar:1.10.0]
  50. ... 26 common frames omitted

分析了一下少了一个encode的jar包,下载encode1.2.3后解决了该问题

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/570305
推荐阅读
相关标签
  

闽ICP备14008679号