Announcement Announcement Module
Collapse
No announcement yet.
Problem with working of @RequestParam in 3.2.3 ! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with working of @RequestParam in 3.2.3 !

    Hi Everyone,

    I recently updated my spring jars from 3.2.2 to 3.2.3.

    I feel there is some problem with working of @RequestParam.

    When I was using Spring 3.2.2, for some parameters, I was not always passing the value then, @RequestParam annotation was not giving any error, which I believe should, since the default value of required attribute is true.

    Second, now with Spring 3.2.3, even if specify @RequestParam(required = false) the following exception is generated if I dont pass any value for 'userId'

    Code:
    org.springframework.web.bind.MissingServletRequestParameterException: Required Long parameter 'userId' is not present
           at org.springframework.web.method.annotation.RequestParamMethodArgumentResolver.handleMissingValue(RequestParamMethodArgumentResolver.java:202) ~[spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:108) ~[spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) ~[spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162) ~[spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:123) ~[spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) ~[spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) [spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) [spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) [servlet-api.jar:na]
           at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) [spring-webmvc-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) [servlet-api.jar:na]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.25]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.25]
           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:150) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) [spring-security-web-3.2.0.M1.jar:3.2.0.M1]
           at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) [spring-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.25]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.25]
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) [catalina.jar:7.0.25]
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) [catalina.jar:7.0.25]
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [catalina.jar:7.0.25]
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) [catalina.jar:7.0.25]
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) [catalina.jar:7.0.25]
           at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) [catalina.jar:7.0.25]
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.25]
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [catalina.jar:7.0.25]
           at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) [tomcat-coyote.jar:7.0.25]
           at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) [tomcat-coyote.jar:7.0.25]
           at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309) [tomcat-coyote.jar:7.0.25]
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_17]
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_17]
           at java.lang.Thread.run(Thread.java:722) [na:1.7.0_17]

    Thanks,
    Vivekanand Alampally..

  • #2
    Hello

    Could you post the Controller's method? Perhaps some detail is around there....

    In your error stack trace Spring Security appears too....

    Comment


    • #3
      Originally posted by dr_pompeii View Post
      Hello

      Could you post the Controller's method? Perhaps some detail is around there....

      In your error stack trace Spring Security appears too....
      Well, i'm joining this thread since i've some issues with @RequestParam as well.

      this is my method

      Code:
        @RequestMapping(value="/TestAction", method=RequestMethod.GET)
          @ResponseBody
          public String TestAction(
          		@RequestParam(value="Argument",required=false) Long argument
          		)
          {
          	if ( argument==null)
          		return  "Not supplied";
          	else
          		return argument.toString();
          }
      with spring 3.0.x the method was woring in all of the following cases:

      1) /TestAction.htm
      2) /TestAction.htm?Argument=

      now with spring 3.2.3 and RequestMappingHandlerAdapter it works only in case 1), while in case 2) i get a 400 error.

      While if i use the old AnnotationMethodHandlerAdapter it works in both cases.

      Comment


      • #4
        The same error is happening to me. I moved from 3.2.2 to 3.2.3 and I am getting that error.

        Someone solved?

        Regards,
        Alberto

        Comment


        • #5
          Originally posted by ranob View Post
          The same error is happening to me. I moved from 3.2.2 to 3.2.3 and I am getting that error.

          Someone solved?

          Regards,
          Alberto

          https://jira.springsource.org/browse/SPR-10402

          it's a bug, but I DONT AGREE with them.
          if it's a bug for 3.2.2, then what is it for 3.2.1, 3.2.0, .... ?

          so, change code for 3.2.3 or keep using 3.2.2
          IT'S A VERY BAD THING!!!!!

          Comment


          • #6
            Originally posted by helppass View Post
            https://jira.springsource.org/browse/SPR-10402

            it's a bug, but I DONT AGREE with them.
            if it's a bug for 3.2.2, then what is it for 3.2.1, 3.2.0, .... ?

            so, change code for 3.2.3 or keep using 3.2.2
            IT'S A VERY BAD THING!!!!!
            it's a regression bug that has been solved in 3.2.4. i'm waiting for that release before upgrade

            Comment

            Working...
            X