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

enable form proxies in a modular classloading environment

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 8.0.2
    • Component/s: Databind 2
    • Security Level: Jimmy
    • Labels:
      None
    • Environment:

      e.g.
      glassfish 4.1.1
      wildfly 9

    • gh.sprint.customfield.default.name:
      ZK 8.0.2 S2

      Description

      Concept
      assume the following application containing 2 modules:

      myapp.ear
      +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 ZK-2932).
      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
      /repository/org/zkoss/zk/zkbind-api/8.0.1.1
      /repository/org/zkoss/zk/zkbind-impl/8.0.1.1

      and the ear can be built using
      mvn clean package

      resulting ear in:
      /zkform-ear/target/zkform.ear

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                DevChu DevChu
                Reporter:
                cor3000 cor3000
              • Votes:
                0 Vote for this issue
                Watchers:
                4 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 - 2 days, 3 hours
                  2d 3h