assume the following application containing 2 modules:
+ejb-module (contains a Person class)
+war-module (ZK webapp using form proxy around the Person class)
since modern JEE containers use modular classloaders the classloader of the ejb module is not aware of the classes in the war file.
This currently leads to class loading Exceptions (see
E.g. the FormProxyObject interface is not visible when creating a zk form proxy around the Person object.
This can be solved by placing the required Interfaces/Annotations into a shared classpath (visible for both modules ear and war)
Also the javaassist.jar needs to be placed into a shared lib folder.
The zkbind.jar which contains the required interfaces can be split in a way that only Interfaces/Annotations are actually shared, and the implementation classes remain in the war file.
I attached an initial working example which consists of
- the split zkbind-api.jar / zkbind-impl.jar (so far manually split there might be other interfaces that need to be added to the api jar)
- a maven project example generating an ear file that can be deployed into a wildfly/glassfish
To test the jars can be placed into the local .m2 folder
and the ear can be built using
mvn clean package
resulting ear in:
GOAL (the above is just a concept to illustrate the problem and provide first idea how this could be addressed)
It has to be decided if splitting the jar file is the best option to do this, or if there is a better approach to allow modular class loading.