開發過程中的小問題總結

問題1:Full authentication is required to access this resource

401 Unauthorized

"errors" : [ {
      "message" : "Full authentication is required to access this resource",
      "type" : "UnauthorizedError"
   } ]

 

原因:

security-spring.xml中

<sec:intercept-url :這裏面指定的路徑有先後順序

個人解決方法:

具體路徑指定先行,所有路徑放在最後.

簡單地加載順序問題,引以爲戒.

 

 

問題2:調用方法到dao的時候,dao值爲空,報:null point exception

原因:

原來有的定義

自己的方法定義

自己調用其他人的方法,spring配置不齊全

 

 解決方法:照着原始的,補全自己的配置

 spring基本配置問題引以爲戒

 

 

 

問題3:複用其他人的方法後,系統啓動報錯,類不能創建

原因:他人的類,已經在spring容器中創建,複用他人的類不需要自己在重新創建bean

解決方法:去除自己在spring的配置文件中的對應類的配置

 spring基本配置問題引以爲戒

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章