我在我的項目中使用Apache Shiro。目前我正在使用1.1.0版本,現在我試圖將Shiro組件遷移到最新版本1.2.1。但是當我嘗試對數據庫進行用戶身份驗證時,由於某種原因,這種身份驗證不起作用,而且我沒有收到任何錯誤,但身份驗證沒有發生。使用shiro對數據庫進行身份驗證1.2.1
以下是我在shiro.ini文件中給出的數據庫詳細信息。
[main]
cacheManager = com.cacheManager.ShiroCacheManager
securityManager.cacheManager = $cacheManager
jdbcRealm=org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.authenticationQuery = select user_pass from users where user_name = ?
jdbcRealm.userRolesQuery = select role_name from user_roles where user_name = ?
ds = com.mysql.jdbc.jdbc2.optional.MysqlDataSource
ds.serverName = 192.168.0.75
ds.port = 3306
ds.user = test
ds.databaseName = appfuse
jdbcRealm.dataSource = $ds
但仍然沒有打到數據庫。我正在使用tomcat服務器,並試圖使用guice和shiro整合的例子...
在這方面的任何幫助,真的很感激,並提前感謝您的幫助!
感謝&問候,
古普塔Katakam
您是否收到任何特定錯誤?你能分享一下嗎?如果您刪除緩存管理器會發生什麼情況? – jbunting