Uploaded image for project: 'JOC - JobScheduler Operations Center'
  1. JOC - JobScheduler Operations Center
  2. JOC-1955

The JOC Cockpit license check should remain compatible with all Licensed Binary Code library versions

    XMLWordPrintable

Details

    • Feature
    • Status: Released (View Workflow)
    • Medium
    • Resolution: Fixed
    • None
    • 2.7.3
    • None
    • None

    Description

      Current Situation

      • Licensed Binary Code (see JS7 - How to apply a JS7 License Key)
        • Old Version (Releases before 2.7.1, 2.5.9, 2.6.6)
          • The Licensed Binary Code uses logging based on logging libraries (e.g.: slf4j, log4j).
        • Current Version (Later Releases)
          • The Licensed Binary Code logs to the stdout and stderr channels.
      • JOC Cockpit
        • JOC Cockpit uses the Licensed Binary Code to perform a license check.
        • The check is performed automatically during startup and can also be triggered manually.
        • This is implemented with an isolated ClassLoader, which ensures that only the necessary dependencies are loaded for the Licensed Binary Code.
        • Recent asynchronous logging changes in JOC Cockpit have caused issues with "Old" Licensed Binary Code versions, as not all required libraries are included.
          • As a result, license checks fail
            • Note: As the check fails, a valid commercial license cannot be verified, and JOC is regarded as operating under an Open-Source license.
            • and throw the following exception:
              2024-11-25T16:16:39,133 ERROR servlet-init c.s.j.c.c.JocClusterConfiguration - java.lang.reflect.InvocationTargetException
              java.lang.reflect.InvocationTargetException: null
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
              at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
              at com.sos.joc.cluster.configuration.JocClusterConfiguration.clusterMode(JocClusterConfiguration.java:223) ~[sos-joc-cluster-2.7.2-SNAPSHOT.jar:?]
              at com.sos.joc.cluster.configuration.JocClusterConfiguration.<init>(JocClusterConfiguration.java:71) ~[sos-joc-cluster-2.7.2-SNAPSHOT.jar:?]
              at com.sos.joc.classes.cluster.JocClusterService.start(JocClusterService.java:109) ~[sos-webservices-joc-global-2.7.2-SNAPSHOT.jar:?]
              at com.sos.joc.servlet.JocServletContainer.lambda$init$1(JocServletContainer.java:111) ~[sos-webservices-joc-global-2.7.2-SNAPSHOT.jar:?]
              at java.base/java.lang.Thread.run(Thread.java:842) [?:?]
              Caused by: java.lang.NoClassDefFoundError: com/lmax/disruptor/EventTranslatorVararg
              at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
              at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012) ~[?:?]
              at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?]
              at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524) ~[?:?]
              at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427) ~[?:?]
              at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421) ~[?:?]
              at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) ~[?:?]
              at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420) ~[?:?]
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
              

      Desired Behavior

      • The JOC Cockpit license check should remain compatible with all Licensed Binary Code versions.
      • In case of failure due to missing dependencies or issues during Licensed Binary Code method calls, a descriptive error message should be presented:
        Licensed Binary Code check failed. Please ensure the current Licensed Binary Code is used

        (along with the full error stack).

      Workaround

      Test Instructions

      • Test Old Version
        • Positive Licensed Binary Code Check
          • Use the attached file js7-license-old-with-logger.jar and place it in the JETTY_BASE/lib/ext/joc directory.
          • Ensure that only one js7-license{}.jar{*} file is present in this location.
          • Test without a commercial license:
            • Ensure that the JETTY_BASE/resources/joc/license directory is empty.
            • Restart JOC Cockpit.
            • Check the JOC Cockpit logs (jetty.log, joc.log)
              • they should not contain any error messages related to the License Check.
          • Test with a commercial license:
            • Ensure that the JETTY_BASE/resources/joc/license directory contains the appropriate license file(s).
            • Restart JOC Cockpit.
            • Check the JOC Cockpit logs (jetty.log, joc.log)
              • they should not contain any error messages related to the License Check (see the issue description for error message examples).
            • Manually perform "Check License" from the Dashboard view.
              • The License Type should display "Commercial License."
            • Recheck the JOC Cockpit logs (jetty.log, joc.log)
              • they should not contain any error messages related to the License Check (see the issue description for error message examples).
        • Negative Licensed Binary Code Checks
          • Create a copy of the attached jar file.
          • Open the .jar file using a tool such as 7-Zip.
            • Navigate to com\sos\js7\license.
              • Delete the check folder.
          • Use the updated .jar file and repeat the tests described earlier.
            • Expected Result: The check fails, and a descriptive error message is displayed.
      • Test Current Version
        • Download the current version of the Licensed Binary Code (refer to the link in the Workaround section).
        • Perform the tests described above, but use the current version jar file instead of the attached one.

      Attachments

        1. joc.log
          388 kB
          Aakash Rao

        Activity

          People

            re Robert Ehrlich
            ur Uwe Risse
            Aakash Rao Aakash Rao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: