Class-loading conflict between Ceres Core and S2 Reader

Hi,

I ran into a class-loading conflict when running the S2 super-resolution operator from EOMTBX 2.0.1 in SNAP 14. The installed Ceres Core and Sentinel-2 MSI Reader modules are both version 14.0.1. This is on Windows 11 with the bundled Java 21.0.6.

The visible error is:

java.lang.NoClassDefFoundError: Could not initialize class org.eomasters.eomtbx.EomtbxRuntime

The initial failure happens during EOMTBX startup, when it calls org.apache.commons.lang3.SystemUtils.getJavaIoTmpDir(). Earlier in the log, NetBeans reports:

WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.apache.commons.lang3.SystemUtils arbitrarily from one of ModuleCL@35267f36[eu.esa.opt.opttbx.s2msi.reader] and ModuleCL@71620cb5[org.esa.snap.ceres.core] starting from ModuleCL@7e185b44[org.eomasters.eomtbx]

Looking at the installed JARs and manifests:

  • Ceres Core bundles Commons Lang 3.18.0 and exports org.apache.commons.lang3.**.
  • The Sentinel-2 MSI Reader bundles Commons Lang 3.17.0 and exports org.apache.commons.**.

Both copies contain SystemUtils, and EOMTBX directly depends on both modules. So the class is present, but NetBeans refuses to choose between the two providers. Once this fails during static initialization, later operator creation also fails.

Could the Sentinel-2 reader use the Commons Lang copy provided by Ceres Core and avoid bundling and exporting its own copy? Narrowing the reader’s broad org.apache.commons.* export also seems worth checking. I found the same packaging arrangement in the 14.0.0 artifacts.

Replacing the temporary-directory call in EOMTBX would avoid this first failure, but other Commons Lang usages would still be affected.

Best,
Marco

Jira ticket SNAP-4366 created.