Spring中常見問題
1.NoSuchBeanDefinitionException
![image.png image.png](http://static.javashuo.com/static/loading.gif)
2.'..Service' that could not be found service找不到
![image.png image.png](http://static.javashuo.com/static/loading.gif)
3.port 80 was already in use 端口號被佔用
![image.png image.png](http://static.javashuo.com/static/loading.gif)
4.TemplateInputException 模板解析異常或找不到模板
1.檢查模板所在的目錄是否與配置的前綴目錄相同
2.檢查返回的模板是否存在,返回值類型是否一致
3.檢查配置前綴時是否以"/"斜槓結尾
4.控制層的url與客戶端的ur是否一致
![image.png image.png](http://static.javashuo.com/static/loading.gif)
5. 404異常 訪問資源不存在
![image.png image.png](http://static.javashuo.com/static/loading.gif)
6. 500異常 500異常要查看控制檯
![image.png image.png](http://static.javashuo.com/static/loading.gif)
Mybatis中常見問題
1.springboot中添加maven依賴
![image.png image.png](http://static.javashuo.com/static/loading.gif)
2.BadSqlGrammarException 錯誤的sql語句
![image.png image.png](http://static.javashuo.com/static/loading.gif)
![image.png image.png](http://static.javashuo.com/static/loading.gif)
3.BindingException 綁定異常
1.檢查映射文件的路徑配置與實際存儲位置是否一致
2.檢查dao接口的類名是否與映射文件的namespace值相同(不能有空格)
3.檢查dao接口中的方法名是否在映射文件中有對應的id
![image.png image.png](http://static.javashuo.com/static/loading.gif)
![image.png image.png](http://static.javashuo.com/static/loading.gif)
![image.png image.png](http://static.javashuo.com/static/loading.gif)
![綁定異常Service層接口註解異常.png 綁定異常Service層接口註解異常.png](http://static.javashuo.com/static/loading.gif)
4.IllegalArgumentException
緣由:一樣說我sql映射是否出現了重複性的定義(例如:分別以註解方式和xml配置文件方式進行定義,也就是說在同一個namespace下出現了重複的元素id)
![image.png image.png](http://static.javashuo.com/static/loading.gif)
5.SAXParseException xml解析問題
![image.png image.png](http://static.javashuo.com/static/loading.gif)