RANGER-5646: Exclude duplicate Hive/Hadoop JARs from hive plugin packaging#1019
Merged
Conversation
…aging. Stop whitelisting Jackson 2.17, httpclient/httpcore, hppc, and other libraries HiveServer2 already provides so audit-server REST delivery no longer fails with HTTP 401 from plugin classpath version skew. Co-authored-by: Cursor <cursoragent@cursor.com>
mneethiraj
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Fixes RANGER-5646: Hive plugin audit delivery to the central audit ingestor fails with HTTP 401 when duplicate libraries in
lib/ranger-hive-plugin-impl/conflict with HiveServer2’s classpath.Problem
When
xasecure.audit.destination.auditserver=true, the Hive plugin usesRangerAuditServerDestination(Jersey 2 REST client) to POST audits to the audit ingestor. Ranger plugin assemblies whitelist dependencies intolib/ranger-hive-plugin-impl/; anything listed is loaded on the isolated plugin classloader.The Hive assembly currently whitelists JARs that HiveServer2 already provides at different versions on its application classpath (Jackson 2.17 from Ranger build vs 2.16 on Hive 4.x, httpclient/httpcore, hppc, commons-collections, etc.). Version skew across classloaders breaks the Jersey audit client’s auth/serialization path:
Solution
Tighten the
lib/ranger-hive-plugin-implwhitelist indistro/src/main/assembly/hive-agent.xml:hppc, Ranger-pinned Jackson 2.17 (jackson-core,jackson-databind,jackson-annotations,jackson-jaxrs-*),httpclient,httpcore,httpcore-nio,commons-collections,javax.annotation-api,joda-time, duplicatejackson-module-jaxb-annotationsentries.jackson-module-jaxb-annotations:2.16.1(Hive 4.x–aligned JAXB support for Jersey JSON) instead of${fasterxml.jackson.version}(2.17).No Java source, POM, or Docker changes — packaging only.
Changes
distro/src/main/assembly/hive-agent.xmllib/ranger-hive-plugin-implwhitelist: drop Hive/Hadoop duplicate deps; pinjackson-module-jaxb-annotations:2.16.1Removed from plugin-impl whitelist
com.carrotsearch:hppccom.fasterxml.jackson.core:jackson-*(2.17)com.fasterxml.jackson.jaxrs:jackson-jaxrs-*(2.17)com.fasterxml.jackson.module:jackson-module-jaxb-annotations(2.17)commons-collections:commons-collectionsjavax.annotation:javax.annotation-apijoda-time:joda-timeorg.apache.httpcomponents:httpclientorg.apache.httpcomponents:httpcore/httpcore-nioRetained (audit + plugin runtime)
jersey-client,jersey-common,jersey-media-json-jackson,jakarta.ws.rs-apijackson-module-jaxb-annotations:2.16.1httpasyncclient,httpmime,solr-solrj,jetty-client, Graal/ICU,hadoop-shaded-guavaHow was this patch tested?
Test plan
distrowith-P-all,ranger-hive-plugin).lib/ranger-hive-plugin-impl/in tarball does not contain:hppc,httpclient,httpcore,jackson-core-2.17*,commons-collections-3.2.2,hive-*.jersey-client,ranger-audit-dest-auditserver,jackson-module-jaxb-annotations-2.16.1.Build example: