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

   ### Version
   
   main branch (2.0.0-SNAPSHOT, eb988d1)
   
   ### Describe what's wrong
   
   The launch scripts accept Java 17 or newer, but add the `--add-opens` flags 
only when the JVM is
   exactly 17:
   
   - `bin/gravitino.sh.template:158`
   - `bin/gravitino-iceberg-rest-server.sh.template:157`
   - `bin/gravitino-lance-rest-server.sh.template:157`
   - `bin/gravitino-optimizer.sh.template:53`
   
   each guarded by `if [[ "$JVM_VERSION" -eq 17 ]]`. On Java 21 none of the 
flags are set. Arrow,
   used by the Lance table operations, then fails to initialize, and creating a 
Lance table through
   the Gravitino API returns 500.
   
   ### Error message and/or stacktrace
   
   ```
   HTTP 500 {"type":"ExceptionInInitializerError","message":"Server error while 
processing request: java.lang.ExceptionInInitializerError"}
   Caused by: java.lang.RuntimeException: Failed to initialize MemoryUtil. You 
must start Java with
   `--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED`
     at org.lance.Dataset.create(Dataset.java:139)
     at 
org.apache.gravitino.catalog.lakehouse.lance.LanceTableOperations.createDataset(LanceTableOperations.java:486)
   ```
   
   ### How to reproduce
   
   1. Start the server with `JAVA_HOME` pointing at a Java 21 JDK.
   2. Create a lakehouse-generic catalog and a schema, then create a table with
      `"properties": {"format": "lance", "location": "/tmp/lance_t"}`.
   3. The response is 500. The same steps on Java 17 succeed.
   
   ### Additional context
   
   Requirement: the scripts set the flags for every Java version they accept 
(17 and newer).
   Related: #10330 (Java version check in the scripts).


-- 
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