-
Bug
-
Resolution: Fixed
-
Later
-
8.0.4.2
-
None
-
None
-
None
Steps to Reproduce
- put attached jar into your project
- 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