最新的 shiro 版本破坏了我的 webapp [shiro-all-1.5.1.jar]

Latest shiro release broke my webapp [ shiro-all-1.5.1.jar ]

我用最新的 shiro 版本 1.5.1 升级了我的网络应用程序,突然它不再工作了。这里的日志错误:

GRAVE: 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 的使用

无论如何,感谢您的报告,我们很快就会解决这个问题!