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

ZK can't work with Java unified expression language standard implementation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Later Later
    • 8.5.0
    • 8.0.4.2
    • None
    • None

      Steps to Reproduce

      1. put attached jar into your project
      2. load the zul

      Current Result

      java.lang.ClassCastException: de.odysseus.el.ExpressionFactoryImpl cannot be cast to org.zkoss.zel.ExpressionFactory
      at org.zkoss.zel.ExpressionFactory.newInstance(ExpressionFactory.java:187) ~[zel-8.0.2.1-Eval.jar:8.0.2.1]
      at org.zkoss.zel.ExpressionFactory.newInstance(ExpressionFactory.java:106) ~[zel-8.0.2.1-Eval.jar:8.0.2.1]
      at org.zkoss.zel.Util.getExpressionFactory(Util.java:126) ~[zel-8.0.2.1-Eval.jar:8.0.2.1]

      Expected Result

      no error

      Root Cause

      In org.zkoss.zel.ExpressionFactory.discoverClassName(), it gets a class name from service API first getClassNameServices(), so it will get de.odysseus.el.ExpressionFactoryImpl from juel-spi-2.2.7.jar.
      Since org.zkoss.zel.ExpressionFactory is not a Java EE standard class, no standard implementation can be cast into it. Hence, get a class name from service API might not get something useful.

      Workaround

      • remove className = getClassNameServices(tccl); and override ExpressionFactory

        1. juel-spi-2.2.7.jar
          0.8 kB
        2. juel-impl-2.2.7.jar
          106 kB
        3. 3642.zul
          0.2 kB

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

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 30 minutes
                5h 30m