mchades opened a new issue, #12444:
URL: https://github.com/apache/gravitino/issues/12444

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   When `GRAVITINO_CLASSPATH` is initially unset, `common.sh` prepends a path
   separator before the configuration directory. After the library directory is
   added, the resulting classpath contains an empty entry:
   
   ```text
   <gravitino-home>/libs/*::<gravitino-home>/conf
   ```
   
   Java interprets an empty classpath entry as the current working directory.
   Classes present there can therefore be loaded by the application classloader
   and shadow dependencies from an isolated catalog classloader.
   
   ### Error message and/or stacktrace
   
   Loading an Iceberg catalog failed when a stale `FileSystemUtils.class` was
   present in the working directory:
   
   ```text
   java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
       at org.apache.gravitino.iceberg.common.ops.IcebergCatalogWrapper.<init>(
           IcebergCatalogWrapper.java:97)
   Caused by: java.lang.ClassNotFoundException:
       org.apache.hadoop.conf.Configuration
   ```
   
   The required Hadoop class was present in the Iceberg catalog libraries, but 
the
   application classloader had loaded the shadowing class from the working
   directory.
   
   ### How to reproduce
   
   1. Build the distribution from the main branch.
   2. Leave `GRAVITINO_CLASSPATH` unset.
   3. Start Gravitino from a directory containing classes that overlap with a
      catalog dependency.
   4. Inspect the Java command line and observe `libs/*::conf`.
   5. Load the affected catalog.
   
   ### Additional context
   
   `common.sh` should initialize the classpath without a leading empty entry and
   append the configuration directory conditionally.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to