Packaging Applications"
Line 20: | Line 20: | ||
==Notice for Form Binding == | ==Notice for Form Binding == | ||
− | ( | + | (Editing in progress...) |
+ | |||
+ | {{versionSince | 9.6.3}} | ||
+ | |||
+ | If you package multiple WAR files and EJB as an EAR file and use form binding, you need to package zkbind jar in the following way, or you might encounter the error: | ||
+ | |||
+ | <code>java.lang.NoClassDefFoundError: org/zkoss/bind/proxy/FormProxyObject</code> | ||
+ | |||
+ | # put <code>zkbind-api.jar</code> and <code>javassist.jar</code> in a shared library | ||
+ | # package <code>zkbind-impl.jar</code> in a WAR. | ||
+ | # make sure a WAR doesn't contain <code>zkbind-api.jar</code> | ||
+ | |||
+ | '''myapp.ear''' | ||
+ | <syntaxhighlight> | ||
+ | lib/javassist.jar | ||
+ | lib/zkbind-api.jar | ||
+ | myapp-ejb.jar (MyEntity.java) | ||
+ | myapp.war/WEB-INF/lib/zkbind-impl.jar | ||
+ | myapp.war/WEB-INF/lib/...other ZK jars (but NO zkbind-api.jar here) | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === Underlying Details === | ||
{{ZKDevelopersReferencePageFooter}} | {{ZKDevelopersReferencePageFooter}} |
Revision as of 08:30, 3 March 2023
Package Single Version
ZK doesn't support to run 2 different versions in a single web application. Mixing Compact Edition/official with Evaluation is not allowed. Please be sure you package only one single version of ZK JAR into a WAR.
For example, if you include zul:9.6.0 and zkex:9.6.3, then you will see messages when starting a server:
2023-03-02 09:21:44 [INFO ] ConfigParser:116 - Ignore jar:file:/Users/yourName/.m2/repository/org/zkoss/zk/zkex/9.6.3/zkex-9.6.3.jar!/metainfo/zk/config.xml
Cause: ZK version must be 9.6.3 or later, not 9.6.0
...
Your ZK binary is being altered and may not work as expected. Please contact us at info@zkoss.org for assistance.
This is a not-recommended practice. Since ZK stores its configurations (parsed from zk.xml
) as a static object, all your zk applications in the same application server will have the same configurations. If you change a configuration (library property), it will affect all zk applications.
Package as EAR
An EAR file contains one or more JAR and WAR.
Notice for Form Binding
(Editing in progress...)
Since 9.6.3
If you package multiple WAR files and EJB as an EAR file and use form binding, you need to package zkbind jar in the following way, or you might encounter the error:
java.lang.NoClassDefFoundError: org/zkoss/bind/proxy/FormProxyObject
- put
zkbind-api.jar
andjavassist.jar
in a shared library - package
zkbind-impl.jar
in a WAR. - make sure a WAR doesn't contain
zkbind-api.jar
myapp.ear
lib/javassist.jar
lib/zkbind-api.jar
myapp-ejb.jar (MyEntity.java)
myapp.war/WEB-INF/lib/zkbind-impl.jar
myapp.war/WEB-INF/lib/...other ZK jars (but NO zkbind-api.jar here)
Underlying Details