Bootstrap

SSM框架—java.lang.NullPointerException,空指针异常处理

Servlet.service() for servlet [GoodShop] in context with path [/goshop] threw exception [Request processing failed;
nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException

在测试SSM项目时,一直报空指针异常,明明配置文件与代码都没有错,为什么会这样呢?

五月 30, 2018 1:17:53 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [GoodShop] in context with path [/goshop] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException
    at com.xh.goshop.controller.GetRoleController.handleRequest(GetRoleController.java:35)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    at org.springframework.web
;