4 Replies Latest reply on Oct 24, 2007 10:17 AM by igx89

    Method expressions being mistaken for value

      In a jPDL pageflow, doesn't work (javassist exception complaining about not finding that method on the bean) while does.

      Does it work correctly for anyone, or is this likely a global issue?

        • 1. Re: Method expressions being mistaken for value

          Bah, another thing to add to the list of all the things I hate about JForum. A corrected version of the post:

          In a jPDL pageflow,

          <action expression="#{bean.method}" />
          doesn't work (javassist exception complaining about not finding that method on the bean) while
          <action expression="#{bean.method()}" />
          does.

          Does it work correctly for anyone, or is this likely a global issue?

          • 2. Re: Method expressions being mistaken for value

            Ahh, I found the problem. Look at the following code from SeamExpressionEvaluator:

            @Override
             public Object evaluate(VariableResolver resolver) throws ELException
             {
             try {
             try {
             if (me==null && ve==null) {
             initMethodExpression();
             }
             if (me!=null && ve==null) {
             return me.invoke(createELContext(resolver, mapper), new Object[0]);
             }
             } catch (javax.el.ELException e) {
             if (ve==null) {
             initValueExpression();
             }
             if (ve!=null) {
             return ve.getValue(createELContext(resolver, mapper));
             }
             }
             throw new ELException();
             } catch (javax.el.ELException e) {
             throw new ELException(e);
             }
             }


            My problem was that Bean.method was throwing an exception, which was being wrapped by an ELException by JBoss EL and then filtering up out of me.invoke, causing Seam to then try to evaluate it as a value expression (instead of propagating out the exception, like it should be doing). Not sure the best solution here...

            • 3. Re: Method expressions being mistaken for value
              pmuir

              Please file a jira issue for this with details on how to replicate. I think we can do better than we currently are...

              • 4. Re: Method expressions being mistaken for value