RANGER-5650: KMS plugin: package Jackson/Jersey audit client JARs in kms.xml for audit-server delivery#1025
Merged
Conversation
…kms.xml for audit-server delivery Add Jackson, Jersey client, and HK2 coordinates to ranger-kms-plugin-impl so the isolated plugin classloader can POST audit batches to the audit-server ingestor without LinkageError or Jersey SPI failures. https: //issues.apache.org/jira/browse/RANGER-5650 Co-authored-by: Cursor <cursoragent@cursor.com>
mneethiraj
approved these changes
Jun 19, 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.
Summary
Fixes KMS plugin audit delivery to the audit-server / audit ingestor when
xasecure.audit.destination.auditserver=true(RANGER-5650).The KMS Ranger plugin runs in
RangerPluginClassLoaderunder the KMS Tomcat WAR (ranger-kms-plugin-impl). Without a self-contained Jackson + Jersey client stack in plugin-impl, audit batch POSTs fail (JsonUtilsV2/LinkageError, Jersey SPIClassCastException, HK2 injection errors).This follows the HBase / RANGER-5644 pattern (add client JARs to plugin-impl), not the Kafka / RANGER-5642 pattern (remove duplicates from host classpath). Duplicating Jackson/Jersey in both
WEB-INF/libandplugin-implis intentional — the isolated plugin classloader must own its audit REST client copies.Problem
When audit-server destination is enabled on KMS, the plugin cannot serialize and POST audit batches:
LinkageError/NoClassDefFoundError: JsonUtilsV2ObjectMapperloaded by both WAR and plugin classloadersWadlAutoDiscoverable/AutoDiscoverableClassCastExceptionMultiException/ HK2 injection failuresRangerAuditServerDestinationREST client fails on first batchChanges
distro/src/main/assembly/kms.xmlranger-kms-plugin-impldependency setAdded to plugin-impl:
jackson-annotations,jackson-core,jackson-databind,jackson-jaxrs-base,jackson-jaxrs-json-provider,jackson-module-jaxb-annotationsjakarta.ws.rs-api,javax.injectjersey-client,jersey-common,jersey-entity-filtering,jersey-media-json-jackson,jersey-hk2,jersey-serverhk2-api,hk2-locator,hk2-utils,hk2,hk2-coreExplicitly not added:
jersey-container-*— causes KMS startup/runtime failures when placed in plugin-implRelated
Test plan
Assembly static check
kms.xmllists Jackson, Jersey client, and hk2 underranger-kms-plugin-impl:grep -E 'jackson-|jersey-client|jersey-common|jersey-server|jersey-hk2|hk2-' distro/src/main/assembly/kms.xmljersey-containerentries in plugin-impl whitelistRebuild KMS tarball
mvn package -Pranger-kms -pl '!plugin-kylin,!ranger-kylin-plugin-shim' -DskipTests -Dcheckstyle.skip=true -Dpmd.skip=true -Drat.skip=trueOutput:
target/ranger-*-kms.tar.gzTarball verify
Must be present under
ews/webapp/WEB-INF/lib/ranger-kms-plugin-impl/:jackson-*-*.jar(6 artifacts)jersey-client-*.jar,jersey-common-*.jar,jersey-entity-filtering-*.jar,jersey-media-json-jackson-*.jar,jersey-hk2-*.jar,jersey-server-*.jarhk2-*.jar,hk2-api-*.jar,hk2-core-*.jar,hk2-locator-*.jar,hk2-utils-*.jarranger-audit-dest-auditserver-*.jarMust NOT be present:
jersey-container-*.jarManual testing (generic)
ranger-kmsDocker image) with audit-server destination enabled inranger-kms-audit.xml.ranger-kms-plugin-implclasspath is loaded.LinkageError,JsonUtilsV2,MessageBodyWriter, orFailed to send audit batcherrors attributable to missing Jackson/Jersey in plugin-impl.repo:<kms_service_name>count increases).adminexcludes KMS repoType by design).What was tested locally
kms.xmlensure-kms-plugin-audit-jars.sh --check-onlywithout brownfield copyrepo:dev_kmscount increased after key ops