Uploaded image for project: 'Blossom'
  1. Blossom
  2. BLOSSOM-226

Call to annotated method @RequestMapping on a template ends in Argument type mismatch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.1.2
    • 3.0.2
    • None
    • None
    • Windows 7 x64
      Tomcat 7
      Magnolia 5.4.2
      Spring 4.2.1

      Call to an annoted method @RequestMapping on a template ends in Argument type mismatch when I specify a parameter of type info.magnolia.context.Context

      Spring resolves the Context beeing an object of type org.springframework.validation.support.BindingAwareModelMap rather than a an instance of MgnlContext.getInstance() thus resulting in a Argument type mismatch.

      Here is the stack trace

      HandlerMethod details: 
      Controller [com.foo.bar.template.WebPage]
      Method [public java.lang.String com.foo.bar.template.WebPage.handleRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,info.magnolia.context.Context,javax.jcr.Node) throws javax.jcr.RepositoryException]
      Resolved arguments: 
      [0] [type=info.magnolia.module.blossom.support.ForwardRequestWrapper] [value=info.magnolia.module.blossom.support.ForwardRequestWrapper@20415821]
      [1] [type=info.magnolia.cms.security.SecurityCallbackFilter$StatusSniffingResponseWrapper] [value=info.magnolia.cms.security.SecurityCallbackFilter$StatusSniffingResponseWrapper@2200ef12]
      [2] [type=org.springframework.validation.support.BindingAwareModelMap] [value={}]
      [3] [type=info.magnolia.audit.MgnlAuditLoggingContentDecoratorNodeWrapper] [value=node /Test]
      
          at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:225)
          at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
          at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111)
          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:806)
          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:729)
          at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
          at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
          at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
          at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
          ... 141 more
      Caused by: java.lang.IllegalArgumentException: argument type mismatch
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
          ... 149 more
      

        Acceptance criteria

              tmattsson Tobias Mattsson
              yorkish Ugo La Giorgia
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD