Tapestry
  1. Tapestry
  2. TAPESTRY-1419

Bracket notation with addition in OGNL expression causes failure to find appropriate listener

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Tapestry 4.1.2 snapshot from 4-16, OGNL 2.7 snapshot from 4-14, WinXP, Firefox 2

      Description

      Prior to upgrading our Tapestry 4.1.2 snapshot to one that required OGNL 2.7, this snippet found the listener and printed to the console:

      .html:
      <link jwcid="@DirectLink" listener="listener:theListener" parameters="ognl:

      {index + 1}

      ">test</link>

      .java:
      public int getIndex()
      {
      return 2;
      }

      public void theListener(int idx)
      {
      System.out.println("listener called");
      }

      With the latest Tapestry and OGNL snapshots you get the error page and the below stack trace. Note this works fine without the "+ 1" in the listener parameters.

      1. org.apache.hivemind.ApplicationRuntimeException: Failure invoking listener method 'public void collective.md.ui.pages.DirectorAccount.theListener(int)' on $DirectorAccount_448@3c1[DirectorAccount]: argument type mismatch
        org.apache.tapestry.listener.ListenerMethodInvokerImpl#invokeListenerMethod (ListenerMethodInvokerImpl.java:161)
        org.apache.tapestry.listener.ListenerMethodInvokerImpl#searchAndInvoke (ListenerMethodInvokerImpl.java:129)
        org.apache.tapestry.listener.ListenerMethodInvokerImpl#invokeListenerMethod (ListenerMethodInvokerImpl.java:70)
        org.apache.tapestry.listener.SyntheticListener#actionTriggered (SyntheticListener.java:52)
        org.apache.tapestry.binding.ListenerMethodBinding#actionTriggered (ListenerMethodBinding.java:77)
        org.apache.tapestry.listener.ListenerInvokerTerminator#invokeListener (ListenerInvokerTerminator.java:50)
        $ListenerInvoker_111fb62388f#invokeListener ($ListenerInvoker_111fb62388f.java:-1)
        org.apache.tapestry.link.DirectLink#trigger (DirectLink.java:106)
        org.apache.tapestry.engine.DirectService#triggerComponent (DirectService.java:170)
        org.apache.tapestry.engine.DirectService#service (DirectService.java:146)
        $IEngineService_111fb62390e#service ($IEngineService_111fb62390e.java:-1)
        org.apache.tapestry.services.impl.EngineServiceOuterProxy#service (EngineServiceOuterProxy.java:72)
        org.apache.tapestry.engine.AbstractEngine#service (AbstractEngine.java:246)
        org.apache.tapestry.services.impl.InvokeEngineTerminator#service (InvokeEngineTerminator.java:54)
        $WebRequestServicer_111fb6238e6#service ($WebRequestServicer_111fb6238e6.java:-1)
        org.apache.tapestry.services.impl.DisableCachingFilter#service (DisableCachingFilter.java:54)
        $WebRequestServicerFilter_111fb6238e8#service ($WebRequestServicerFilter_111fb6238e8.java:-1)
        $WebRequestServicer_111fb6238ea#service ($WebRequestServicer_111fb6238ea.java:-1)
        $WebRequestServicer_111fb6238e2#service ($WebRequestServicer_111fb6238e2.java:-1)
        org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge#service (WebRequestServicerPipelineBridge.java:61)
        $ServletRequestServicer_111fb6238c4#service ($ServletRequestServicer_111fb6238c4.java:-1)
        org.apache.tapestry.request.DecodedRequestInjector#service (DecodedRequestInjector.java:55)
        $ServletRequestServicerFilter_111fb6238c0#service ($ServletRequestServicerFilter_111fb6238c0.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        collective.ui.custom.HibernateFilter#service (HibernateFilter.java:37)
        $ServletRequestServicerFilter_111fb6238be#service ($ServletRequestServicerFilter_111fb6238be.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        collective.ui.custom.LuceneIndexFilter#service (LuceneIndexFilter.java:24)
        $ServletRequestServicerFilter_111fb6238bc#service ($ServletRequestServicerFilter_111fb6238bc.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        org.apache.tapestry.multipart.MultipartDecoderFilter#service (MultipartDecoderFilter.java:52)
        $ServletRequestServicerFilter_111fb6238ba#service ($ServletRequestServicerFilter_111fb6238ba.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        org.apache.tapestry.services.impl.SetupRequestEncoding#service (SetupRequestEncoding.java:53)
        $ServletRequestServicerFilter_111fb6238c2#service ($ServletRequestServicerFilter_111fb6238c2.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        $ServletRequestServicer_111fb6238b3#service ($ServletRequestServicer_111fb6238b3.java:-1)
        org.apache.tapestry.ApplicationServlet#doService (ApplicationServlet.java:123)
        collective.ui.CollectiveApplicationServlet#doService (CollectiveApplicationServlet.java:71)
        org.apache.tapestry.ApplicationServlet#doGet (ApplicationServlet.java:104)
        javax.servlet.http.HttpServlet#service (HttpServlet.java:743)
        javax.servlet.http.HttpServlet#service (HttpServlet.java:856)
        org.mortbay.jetty.servlet.ServletHolder#handle (ServletHolder.java:427)
        ... 15 more not displayed
      2. caused by java.lang.IllegalArgumentException: argument type mismatch
        sun.reflect.NativeMethodAccessorImpl#invoke0
        sun.reflect.NativeMethodAccessorImpl#invoke
        sun.reflect.DelegatingMethodAccessorImpl#invoke
        java.lang.reflect.Method#invoke
        org.apache.tapestry.listener.ListenerMethodInvokerImpl#invokeTargetMethod (ListenerMethodInvokerImpl.java:203)
        org.apache.tapestry.listener.ListenerMethodInvokerImpl#invokeListenerMethod (ListenerMethodInvokerImpl.java:146)
        org.apache.tapestry.listener.ListenerMethodInvokerImpl#searchAndInvoke (ListenerMethodInvokerImpl.java:129)
        org.apache.tapestry.listener.ListenerMethodInvokerImpl#invokeListenerMethod (ListenerMethodInvokerImpl.java:70)
        org.apache.tapestry.listener.SyntheticListener#actionTriggered (SyntheticListener.java:52)
        org.apache.tapestry.binding.ListenerMethodBinding#actionTriggered (ListenerMethodBinding.java:77)
        org.apache.tapestry.listener.ListenerInvokerTerminator#invokeListener (ListenerInvokerTerminator.java:50)
        $ListenerInvoker_111fb62388f#invokeListener ($ListenerInvoker_111fb62388f.java:-1)
        org.apache.tapestry.link.DirectLink#trigger (DirectLink.java:106)
        org.apache.tapestry.engine.DirectService#triggerComponent (DirectService.java:170)
        org.apache.tapestry.engine.DirectService#service (DirectService.java:146)
        $IEngineService_111fb62390e#service ($IEngineService_111fb62390e.java:-1)
        org.apache.tapestry.services.impl.EngineServiceOuterProxy#service (EngineServiceOuterProxy.java:72)
        org.apache.tapestry.engine.AbstractEngine#service (AbstractEngine.java:246)
        org.apache.tapestry.services.impl.InvokeEngineTerminator#service (InvokeEngineTerminator.java:54)
        $WebRequestServicer_111fb6238e6#service ($WebRequestServicer_111fb6238e6.java:-1)
        org.apache.tapestry.services.impl.DisableCachingFilter#service (DisableCachingFilter.java:54)
        $WebRequestServicerFilter_111fb6238e8#service ($WebRequestServicerFilter_111fb6238e8.java:-1)
        $WebRequestServicer_111fb6238ea#service ($WebRequestServicer_111fb6238ea.java:-1)
        $WebRequestServicer_111fb6238e2#service ($WebRequestServicer_111fb6238e2.java:-1)
        org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge#service (WebRequestServicerPipelineBridge.java:61)
        $ServletRequestServicer_111fb6238c4#service ($ServletRequestServicer_111fb6238c4.java:-1)
        org.apache.tapestry.request.DecodedRequestInjector#service (DecodedRequestInjector.java:55)
        $ServletRequestServicerFilter_111fb6238c0#service ($ServletRequestServicerFilter_111fb6238c0.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        collective.ui.custom.HibernateFilter#service (HibernateFilter.java:37)
        $ServletRequestServicerFilter_111fb6238be#service ($ServletRequestServicerFilter_111fb6238be.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        collective.ui.custom.LuceneIndexFilter#service (LuceneIndexFilter.java:24)
        $ServletRequestServicerFilter_111fb6238bc#service ($ServletRequestServicerFilter_111fb6238bc.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        org.apache.tapestry.multipart.MultipartDecoderFilter#service (MultipartDecoderFilter.java:52)
        $ServletRequestServicerFilter_111fb6238ba#service ($ServletRequestServicerFilter_111fb6238ba.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        org.apache.tapestry.services.impl.SetupRequestEncoding#service (SetupRequestEncoding.java:53)
        $ServletRequestServicerFilter_111fb6238c2#service ($ServletRequestServicerFilter_111fb6238c2.java:-1)
        $ServletRequestServicer_111fb6238c6#service ($ServletRequestServicer_111fb6238c6.java:-1)
        $ServletRequestServicer_111fb6238b3#service ($ServletRequestServicer_111fb6238b3.java:-1)
        org.apache.tapestry.ApplicationServlet#doService (ApplicationServlet.java:123)
        collective.ui.CollectiveApplicationServlet#doService (CollectiveApplicationServlet.java:71)
        org.apache.tapestry.ApplicationServlet#doGet (ApplicationServlet.java:104)
        javax.servlet.http.HttpServlet#service (HttpServlet.java:743)
        javax.servlet.http.HttpServlet#service (HttpServlet.java:856)
        org.mortbay.jetty.servlet.ServletHolder#handle (ServletHolder.java:427)
        ... 15 more not displayed

        Activity

        Hide
        Ben Dotte added a comment -

        Note this was originally reported in the ognl jira system here: http://jira.opensymphony.com/browse/OGNL-42

        Show
        Ben Dotte added a comment - Note this was originally reported in the ognl jira system here: http://jira.opensymphony.com/browse/OGNL-42
        Hide
        Jesse Kuhnert added a comment -

        Guess you were right - was an ognl bug after all....Fixed and deployed there.

        Show
        Jesse Kuhnert added a comment - Guess you were right - was an ognl bug after all....Fixed and deployed there.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Ben Dotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development