可以获取列表/superadmin/listarea,但无法获取/superadmin/getareaid?areaid=2,路径没问题,数据库有areaid=2包含内容,json无法获取信息。
————项目启动运行成功—————
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
恳请老师和各位同学们帮忙解疑,git clone老师的项目下来运行也是一样的结果。