Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3815

zscript causes MethodNotFoundException when calling a static method in EL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.2
    • 8.5.0
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      1. run the zul below

      <?import java.lang.Math ?>
      <zk>
      	<zscript><![CDATA[
      	//if zscript contains any code including a comment, this page produces a MethodNotFoundException
      	//if you comment out (or remove) the whole zscript, then no exception is thrown.
      	]]></zscript>
      	<div apply="org.zkoss.bind.BindComposer">
      		<label value="@init((Math.sqrt(16)))"/>
      	</div>
      </zk>
      

      Current Result

      org.zkoss.zel.MethodNotFoundException: Unable to find method [sqrt] with [1] parameters
      at org.zkoss.zel.BeanELResolver.invoke(BeanELResolver.java:231)
      at org.zkoss.zel.CompositeELResolver.invoke(CompositeELResolver.java:84)
      at org.zkoss.zel.CompositeELResolver.invoke(CompositeELResolver.java:84)
      at org.zkoss.xel.zel.XelELResolver.invoke(XelELResolver.java:189)
      at org.zkoss.bind.xel.zel.BindELResolver.invoke(BindELResolver.java:161)
      at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:176)
      at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
      at org.zkoss.zkmax.bind.impl.ValueExpressionImplEx.getValue(ValueExpressionImplEx.java:52)
      at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:41)
      at org.zkoss.zkmax.bind.impl.BindEvaluatorXImplEx$LazyBindXelExpression.evaluate(BindEvaluatorXImplEx.java:124)
      at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:46)
      at org.zkoss.bind.impl.InitPropertyBindingImpl.load(InitPropertyBindingImpl.java:58)
      at org.zkoss.bind.impl.PropertyBindingHandler.doLoadBinding(PropertyBindingHandler.java:140)
      at org.zkoss.bind.impl.PropertyBindingHandler.doInit(PropertyBindingHandler.java:350)
      at org.zkoss.bind.impl.BinderImpl.loadComponentProperties0(BinderImpl.java:2466)
      at org.zkoss.bind.impl.BinderImpl.loadComponent0(BinderImpl.java:2435)
      at org.zkoss.bind.impl.BinderImpl.loadComponent0(BinderImpl.java:2440)
      at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:2370)
      at org.zkoss.bind.BindComposer$BinderKeeper$Loader.load(BindComposer.java:548)
      at org.zkoss.bind.BindComposer$BinderKeeper.loadComponentForAllBinders(BindComposer.java:524)
      at org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:191)

      Expected Result

      no exception.

      Debug Info

      • if you comment out (or remove) the whole zscript, then no exception is thrown.

      Workaround

      • remove zscript

            rudyhuang rudyhuang
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 4 hours
                1d 4h