shiro - 最新的 shiro 版本破坏了我的 webapp [shiro-all-1.5.1.jar]
问题描述
我用最新的 shiro 版本 1.5.1 升级了我的 webapp,突然它不再工作了。这里的日志错误:
坟墓: Shiro 环境初始化失败 java.lang.NoClassDefFoundError: org/apache/shiro/cache/CacheManagerAware
这是我的 shiro.ini 似乎是罪魁祸首:
[main]
jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.permissionsLookupEnabled = true
ds = com.mysql.cj.jdbc.MysqlDataSource
ps = org.apache.shiro.authc.credential.DefaultPasswordService
pm = org.apache.shiro.authc.credential.PasswordMatcher
jdbcRealmCredentialsMatcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher
ds.serverName = localhost
ds.serverTimezone=Europe/Berlin
ds.databaseName = ******
ds.user = *******
ds.password = ********
jdbcRealm.credentialsMatcher = $jdbcRealmCredentialsMatcher
jdbcRealm.dataSource = $ds
pm.passwordService = $ps
jdbcRealm.credentialsMatcher = $pm
shiro.loginUrl = /login.jsp
shiro.postOnlyLogout = true
securityManager.realms = $jdbcRealm
securityManager.rememberMeManager.cipherKey = kPH+bIxk5D2deZiIxcaaaA==
当我回到 shiro-all-1.4.2.jar 版本时,一切都恢复正常了。
我什至尝试将这两行添加到我的 shiro.ini 主要部分,但它们没有解决问题
cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $cacheManager
解决方案
我可以确认这个问题,这应该在下一个版本中修复。
https://issues.apache.org/jira/browse/SHIRO-749
此外,“all”模块将来可能会被弃用,我强烈建议不要使用它们,而是只使用你需要的模块(例如,也许你只需要shiro-web
.
临时修复是:a.)还添加对 shiro-cache 的依赖项 b.)通过使用您需要的模块(shiro-web、shiro-guice 等)删除 shiro-all 的使用
无论哪种方式,感谢您的报告,我们很快就会解决这个问题!
推荐阅读
- scala - 如何在 Spark-Scala 数据框中应用布尔索引?
- c++ - 简单 for 循环中的大量时间损失
- android - android - 如何在项目点击时用另一个替换已经打开的片段?(科特林)
- reactjs - 如何在反应中从另一个功能组件设置一个功能组件的状态
- android - EditText 与时间滞后 - Android
- c# - 如何使用 .NET Core 2.1 和 Stream API 在 Cosmos DB 中批量插入
- slurm - Snakemake 在使用 --profile slurm 时给出 InputFunctionException
- php - 使用 Laravel 产品 Youtube 克隆时,本地主机上的 HTTP 错误 500
- python - 如何使用 jupyter notebook 或 SQL 取消透视多个列?
- react-native - 与 mongodb 领域反应本机。尝试 google 登录会导致错误代码 10