Skip to content

Conversation

@j1wonpark
Copy link
Contributor

Why are the changes needed?

When initializing a Hive Metastore-based Iceberg catalog in amoro-ams, a NoClassDefFoundError: com/google/common/collect/ImmutableMap is thrown at runtime.

Hive 3.1.3's HiveConf directly references the original Guava class com.google.common.collect.ImmutableMap, but the Guava dependency in amoro-ams/pom.xml is declared with <scope>test</scope>, so it is excluded from the runtime classpath. All other Guava artifacts in the project are shaded (e.g., amoro-shade-guava-32, iceberg-bundled-guava, flink-shaded-guava) and do not provide classes under the original com.google.common.* package. Additionally, the Hive dependency explicitly excludes Guava via <exclusion>, preventing transitive resolution.

This issue also affects the official distribution and Docker images.

Brief change log

  • Removed <scope>test</scope> from the Guava dependency in amoro-ams/pom.xml so that it defaults to compile scope and is included in the runtime classpath.

How was this patch tested?

  • Run test locally before making a pull request
  • Verified that amoro-ams starts successfully and initializes a Hive Metastore-based Iceberg catalog without NoClassDefFoundError.

Documentation

  • Does this pull request introduce a new feature? no

…ed Iceberg catalog initialization

Signed-off-by: j1wonpark <[email protected]>
@j1wonpark j1wonpark changed the title [Bug] Fix NoClassDefFoundError for Guava ImmutableMap during Hive-based Iceberg catalog initialization [HotFix] Fix NoClassDefFoundError for Guava ImmutableMap during Hive-based Iceberg catalog initialization Jan 29, 2026
@@ -510,7 +510,6 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm encountering the same issue in the Paimon Hive Catalog. This creates a paradox with the current shared packages. Is there a better solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @czy006, thanks for the feedback!

This fix resolves the Paimon Hive Catalog case as well. The root cause is the same — Paimon's HiveCatalog uses unshaded HiveConf from the amoro-ams classpath, and HiveConf internally depends on unshaded Guava (ImmutableMap).

There's no shared package conflict:

  • Amoro uses org.apache.amoro.shade.guava32.*
  • Paimon uses org.apache.paimon.shade.guava30.*
  • Hive/Iceberg uses com.google.common.* (provided by this fix)

All three are separate namespaces — no collision.

If you're seeing a specific error that this fix doesn't cover, could you share the stack trace? Happy to dig into it together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants