Anyone faces the following error? ```[42000][1064]...
# questions-and-troubleshooting
y
Anyone faces the following error?
Copy code
[42000][1064] Failed to execute metadata collection job. Failed to open the off-heap table scanner. java exception details: java.lang.NoClassDefFoundError: Could not initialize class de.javakaffee.kryoserializers.UnmodifiableCollectionsSerializer at com.starrocks.connector.iceberg.IcebergMetadataScanner.initSerializer(IcebergMetadataScanner.java:168) at com.starrocks.connector.iceberg.IcebergMetadataScanner.doOpen(IcebergMetadataScanner.java:109) at com.starrocks.connector.iceberg.AbstractIcebergMetadataScanner.open(AbstractIcebergMetadataScanner.java:70) Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.RuntimeException: Could not access source collection field in java.util.Collections$UnmodifiableCollection. [in thread "Thread-12 ...
on 4.0.5, with iceberg
j
Do you think it's related to this Github issue? See the fix from Yan here.
Screenshot 2026-02-18 at 12.16.43.png
t
@Rocky - give more information about this error and any workarounds.
Copy code
[42000][1064] Failed to execute metadata collection job. Failed to open the off-heap table scanner. java exception details: java.lang.NoClassDefFoundError: Could not initialize class de.javakaffee.kryoserializers.UnmodifiableCollectionsSerializer at com.starrocks.connector.iceberg.IcebergMetadataScanner.initSerializer(IcebergMetadataScanner.java:168) at com.starrocks.connector.iceberg.IcebergMetadataScanner.doOpen(IcebergMetadataScanner.java:109) at com.starrocks.connector.iceberg.AbstractIcebergMetadataScanner.open(AbstractIcebergMetadataScanner.java:70) Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.RuntimeException: Could not access source collection field in java.util.Collections$UnmodifiableCollection. [in thread "Thread-12 ...
on 4.0.5, with iceberg
r
The error you are encountering is a known compatibility issue between Java 17+ and the Kryo serialization library used by the StarRocks Iceberg metadata scanner. Cause StarRocks 4.0.x uses a metadata scanner for Iceberg (often triggered during statistics collection or metadata refresh) that utilizes Kryo for efficient serialization. When running StarRocks on Java 17, the JDK's strict module encapsulation prevents libraries like Kryo from accessing internal fields of classes such as
java.util.Collections$UnmodifiableCollection
via reflection. The
NoClassDefFoundError
is a secondary error resulting from the initial
ExceptionInInitializerError
, which occurred because the JVM blocked access to a private field in the
java.util
package. Workaround To fix this, you must grant the StarRocks Frontend (FE) permission to access these internal Java modules by adding
--add-opens
flags to your JVM configuration. 1. Open your
fe/conf/fe.conf
file. 2. Locate the
JAVA_OPTS
setting. 3. Add the following flags to the
JAVA_OPTS
string:
Copy code
bash
    JAVA_OPTS="-Xmx8192m ... --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED"
Note: If you already have other
--add-opens
or
--add-exports
flags, just append these to the list.
4. Restart the FE node for the changes to take effect. Recommended JVM Flags for Java 17 If you are running StarRocks on Java 17, it is generally recommended to include the following "opens" to avoid similar issues across different connectors:
Copy code
text
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util.concurrent=ALL-UNNAMED
--add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED
--add-opens java.base/java.nio=ALL-UNNAMED
--add-opens java.base/java.math=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
Additional Information * Off-heap Scanner: The "off-heap table scanner" mentioned in the error refers to the component StarRocks uses to scan Iceberg metadata (manifests) efficiently outside the standard Java heap to avoid GC pressure. * Version Note: This specific issue is common in the 3.3.x and 4.0.x branches when performing
ANALYZE
or metadata-heavy operations on Iceberg tables using Java 17. Referencesadministration/management/FE_configuration.md