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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Later
    • Resolution: Fixed
    • Affects Version/s: 8.0.4.2
    • Fix Version/s: 8.5.0
    • Component/s: None
    • Labels:
      None

      Description

      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

        Attachments

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

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

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