Ramachandran Krishnan created RANGER-5718:
---------------------------------------------

             Summary: PDP server logs NoClassDefFoundError for GsonBuilder — 
gson JAR missing from pdp tarball lib/
                 Key: RANGER-5718
                 URL: https://issues.apache.org/jira/browse/RANGER-5718
             Project: Ranger
          Issue Type: Task
          Components: Ranger
            Reporter: Ramachandran Krishnan
            Assignee: Ramachandran Krishnan


h2. Summary
Ranger PDP server logs an ERROR on every plugin initialization when 
policies/tags are 
downloaded from Admin:

{code}
ERROR AbstractRangerAdminClient: failed to create GsonBuilder object
java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder
Caused by: java.lang.ClassNotFoundException: com.google.gson.GsonBuilder
{code}

Policy download and authorization still work because RangerAdminRESTClient uses 
Jackson for REST JSON parsing. The error is non-fatal (caught in init(), gson 
remains null) but is noisy and indicates an incomplete PDP classpath.

h2. Root Cause
distro/src/main/assembly/pdp.xml uses a strict binaries <includes> whitelist 
for 
lib/ dependencies. com.google.code.gson:gson is used by 
AbstractRangerAdminClient (agents-common) but is NOT included in the whitelist, 
unlike other plugin assemblies (KMS, Kafka, Solr, etc.) which explicitly 
include gson.

h2. Notes
* Gson is used for file-based policy sources (EmbeddedResourcePolicySource, 
  LocalFolderPolicySource), not the normal Admin REST download path.
* Error occurs in PolicyRefresher.<init> → 
RangerPluginContext.createAdminClient 
  → AbstractRangerAdminClient.init() during lazy plugin creation on authorize.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to