可以獲取列表/superadmin/listarea,但無法獲取/superadmin/getareaid?areaid=2,路徑?jīng)]問題,數(shù)據(jù)庫有areaid=2包含內(nèi)容,json無法獲取信息。
————項目啟動運(yùn)行成功—————
com.houtai.demo.DemoApplication? ? ? ? ? : Started DemoApplication in 5.638 seconds (JVM running for 8.145)
o.a.c.c.C.[Tomcat].[localhost].[/demo]? ?: Initializing Spring DispatcherServlet 'dispatcherServlet'
o.s.web.servlet.DispatcherServlet? ? ? ? : Initializing Servlet 'dispatcherServlet'
o.s.web.servlet.DispatcherServlet? ? ? ? : Completed initialization in 11 ms
o.a.c.c.C.[.[.[.[dispatcherServlet]? ? ? : Servlet.service() for servlet [dispatcherServlet] in context with path [/demo] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException: null
at com.houtai.demo.web.AreaController.getAreaById(AreaController.java:45) ~[classes/:na]
以上為異常信息,java45為Area area = areaService.getAreaById(areaId);上下文沒錯。異常處理信息errMsg:null
懇請老師和各位同學(xué)們幫忙解疑,git clone老師的項目下來運(yùn)行也是一樣的結(jié)果。
2018-12-29
2019-01-31
getareaid 這個在地址欄上寫錯了,大小寫沒有匹配
2018-12-27
null值可以debug調(diào)試一下看看