ramackri opened a new pull request, #1122:
URL: https://github.com/apache/ranger/pull/1122
## Summary
Fixes `NoClassDefFoundError: com/google/gson/GsonBuilder` logged by the
Ranger PDP server on every plugin initialization when policies/tags are
downloaded from Admin.
The PDP assembly descriptor (`distro/src/main/assembly/pdp.xml`) uses a
strict `lib/` dependency whitelist but did not include `gson`, unlike other
Ranger plugin assemblies (KMS, Kafka, Solr, etc.). As a result,
`ranger-2.9.0-pdp.tar.gz` and the `ranger-pdp` docker image ship without
`gson-*.jar` on the classpath.
Policy download and authorization still work today because
`RangerAdminRESTClient` parses Admin REST responses with Jackson. The error is
non-fatal (`AbstractRangerAdminClient.init()` catches it and leaves `gson`
null) but is noisy and leaves file-based policy sources
(`EmbeddedResourcePolicySource`, `LocalFolderPolicySource`) without Gson
support.
## Changes
- **`distro/src/main/assembly/pdp.xml`**: add
`com.google.code.gson:gson:jar:${gson.version}` to the binaries whitelist
- **`pdp/pom.xml`**: declare explicit `gson` runtime dependency
## Test plan
- [x] Built PDP modules with the change (`mvn install -pl pdp,... -am`)
- [x] Assembly descriptor resolves gson to `gson-2.9.0`
- [x] Docker smoke test on existing `rangernw` stack (isolated PDP on port
16500):
- With `gson-2.9.0.jar` in `lib/`: health READY, `POST
/authz/v1/authorize` → ALLOW, `PolicyRefresher` downloads policies, **no
GsonBuilder ERROR**
- Without gson (pre-fix): same `NoClassDefFoundError` reproduced
- [ ] CI green
- [ ] After merge: rebuild `ranger-*-pdp.tar.gz` and verify `tar -tzf ... |
grep gson`
## Jira
https://issues.apache.org/jira/browse/RANGER-5718
Made with [Cursor](https://cursor.com)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]