[ 
https://issues.apache.org/jira/browse/RANGER-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18100939#comment-18100939
 ] 

Ramachandran Krishnan commented on RANGER-5718:
-----------------------------------------------

Merged with master commit 
details:[https://github.com/apache/ranger/commit/e8afc187e4b00c76e17f69a915b99597d323be43]

 

> 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
>            Priority: Major
>             Fix For: 3.0.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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