【发布时间】:2020-06-26 10:55:34
【问题描述】:
我用最新的 shiro 版本 1.5.1 升级了我的 web 应用程序,但突然它不再工作了。这里的日志错误:
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
【问题讨论】:
标签: shiro