zoukankan      html  css  js  c++  java
  • springmvc中报错Request processing failed;

    今天在整个ssm的时候出现了个低级错误,找了好久才找出来,在发现真理的那一刻,我都有死的冲动了。
    报错如下:
    HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalStateException: Optional int parameter ‘eid’ is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
    type Exception report

    message Request processing failed; nested exception is java.lang.IllegalStateException: Optional int parameter ‘eid’ is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: Optional int parameter ‘eid’ is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)

    root cause

    java.lang.IllegalStateException: Optional int parameter ‘eid’ is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
    org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.handleNullValue(AbstractNamedValueMethodArgumentResolver.java:188)
    org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:94)
    org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77)
    org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157)
    org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124)
    org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:685)
    org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)

    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.70 logs.

    截图如下所示:
    错误截图
    解决方法:
    删除
    这一行代码中的eid后面有个空格,删除掉了就可以了!!

  • 相关阅读:
    Volley的post使用
    android中asynctask的使用实例
    android中HttpClient的应用(POST方法)
    gson在android中的应用
    7、Web应用程序中的安全向量 -- 使用Retail部署配置
    6、Web应用程序中的安全向量 -- customErrors(适当的错误报告和堆栈跟踪)
    5、Web应用程序中的安全向量 -- Open Redirect Attack(开放重定向)
    4、Web应用程序中的安全向量 -- over-posting(重复提交)
    3、Web应用程序中的安全向量 -- cookie盗窃
    2、Web应用程序中的安全向量 -- CSRF/XSRF(跨站请求伪造)
  • 原文地址:https://www.cnblogs.com/a1111/p/12816067.html
Copyright © 2011-2022 走看看