1. 程式人生 > >shiro報錯:No SecurityManager accessible to the calling code

shiro報錯:No SecurityManager accessible to the calling code

報錯資訊:

org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code,either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton.  This is an invalid application configuration.

錯誤原因:

Web.xml配置檔案裡面的shiro過濾器放在了struts2過濾器的後面。

改正方法:

必須先寫

shiro過濾器再配置struts2過濾器,因為是先走shiro再走struts2。