spring shiro整合時自動注入的問題

2021-09-20 05:06:42 字數 604 閱讀 3627

spring mvc和shiro進行整合時,我採用的是註解的方式,也就是@autowired,發現service服務無法再自定義的realm中進行注入,會出現以下錯誤。

error creating bean with name 'shirofilter' defined in class path resource [spring-shiro.xml]: cannot resolve reference to bean 'securitymanager' while setting bean property 'securitymanager'; nested exception is org.springframework.beans.factory.beancreationexception: error creating bean with name 'securitymanager'……

類似於這種錯誤,這是springmvc配置檔案 優先順序不夠的原因造成,需要在web.xml檔案中作調整:

contextconfiglocation

classpath:config/spring.xml,

classpath:config/spring-shiro.xml

整合Hibernate時Annotation的配置

invalid property annotatedclasses of bean class 為何報錯 在hibernate annotation spring 整合的時候出現的 解決方法 annotationsessionfactorybean org.hibernate.dialect.sql...

自頂向下整合 Top Down

子策略 深度優先 depth first 廣度優先 broadth first 優點 a.主控模組 高層元件 得到較早驗證 b.深度優先策略能夠較早驗證乙個完整的功能,增強了開發信心 c.基本不需要開發驅動,減少了這部分的工作量 d.和高層設計順序一致,方便並行開展 e.定位問題容易,支援故障隔離 ...

自頂向下整合 Top Down

優點 方法簡單 效率高 缺點 急於求成 成功率不高 大海撈針 導致即使發現問題也難以定位 無法故障隔離 囫圇吞棗 許多內部介面的錯誤被漏測 適用範圍 小專案 維護型專案 軟體結構不清晰的系統 2 自頂向下整合 top down 子策略 深度優先 depth first 廣度優先 broadth fi...