Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Complete
    • Affects Version/s: 3.2 GA
    • Fix Version/s: 3.2.1
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      with tomcat 7 there is no problem. deploying the same war on tomcat 6 with spring 3.2 creates the following error:

      java.lang.NullPointerException
      at java.util.Hashtable.get(Hashtable.java:334)
      at org.apache.tomcat.util.http.Parameters.getParameterValues(Parameters.java:194)
      at org.apache.tomcat.util.http.Parameters.getParameter(Parameters.java:239)
      at org.apache.catalina.connector.Request.getParameter(Request.java:1042)
      at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:355)
      at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:158)
      at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:158)
      at org.springframework.web.context.request.ServletWebRequest.getParameter(ServletWebRequest.java:113)
      at org.springframework.web.accept.ParameterContentNegotiationStrategy.getMediaTypeKey(ParameterContentNegotiationStrategy.java:60)
      at org.springframework.web.accept.AbstractMappingContentNegotiationStrategy.resolveMediaTypes(AbstractMappingContentNegotiationStrategy.java:46)
      at org.springframework.web.accept.ContentNegotiationManager.resolveMediaTypes(ContentNegotiationManager.java:102)
      at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.getAcceptableMediaTypes(AbstractMessageConverterMethodProcessor.java:189)
      at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:114)
      at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:90)
      at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:189)
      at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:69)
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:122)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:746)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:687)
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)

        Issue Links

          Activity

          Hide
          Juergen Hoeller added a comment -

          Rossen, looks like we're calling HttpServletRequest.getParameter(null) there, which seems to work on Tomcat 7 but not on Tomcat 6... Skipping the check for a null parameter name might be all we need to do there.

          Juergen

          Show
          Juergen Hoeller added a comment - Rossen, looks like we're calling HttpServletRequest.getParameter(null) there, which seems to work on Tomcat 7 but not on Tomcat 6... Skipping the check for a null parameter name might be all we need to do there. Juergen
          Hide
          Rossen Stoyanchev added a comment -

          Indeed, we can restrict ParameterContentNegotiationStrategy to never allow a null parameter name. It was probably set so inadvertently due to a related issue in the MVC namespace and Java config which allow setting favorParameter to true while parameterName does not have a default value of "format" as it should. Both of these will be fixed. In the mean time as a temporary workaround you can set the parameterName explicitly to "format" in your configuration when enabling favorParameter.

          Show
          Rossen Stoyanchev added a comment - Indeed, we can restrict ParameterContentNegotiationStrategy to never allow a null parameter name. It was probably set so inadvertently due to a related issue in the MVC namespace and Java config which allow setting favorParameter to true while parameterName does not have a default value of "format" as it should. Both of these will be fixed. In the mean time as a temporary workaround you can set the parameterName explicitly to "format" in your configuration when enabling favorParameter.
          Hide
          Rossen Stoyanchev added a comment - - edited

          This should now be fixed with 42cdb2.

          Show
          Rossen Stoyanchev added a comment - - edited This should now be fixed with 42cdb2 .

            People

            • Assignee:
              Rossen Stoyanchev
              Reporter:
              masrawi
              Last updater:
              Rossen Stoyanchev
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 15 weeks, 6 days ago