Abhishek Chennaka created KUDU-3768:
---------------------------------------
Summary: Fix SPI Service File Overwriting in kudu-subprocess
Shadow JAR
Key: KUDU-3768
URL: https://issues.apache.org/jira/browse/KUDU-3768
Project: Kudu
Issue Type: Bug
Reporter: Abhishek Chennaka
The {{kudu-subprocess}} module's build configuration does not handle Service
Provider Interface (SPI) merging correctly after the last gradle upgrade. When
multiple dependencies (specifically {{jersey-core}} and {{{}jersey-json{}}})
provide the same registration file at
{{{}META-INF/services/javax.ws.rs.ext.MessageBodyReader{}}}, the Shadow
plugin's default behavior is to overwrite the file rather than append to it.
*Root Cause:* In the current build, {{{}jersey-json{}}}'s service file
overwrites {{{}jersey-core{}}}'s. As a result, the
{{com.sun.jersey.core.impl.provider.entity.StringProvider}} registration is
lost.
*Symptoms:* When Kudu attempts to refresh policies or roles via the Ranger
plugin, the Java subprocess logs the following error and fails to update its
policy cache:
{code:java}
com.sun.jersey.api.client.ClientHandlerException: A message body reader for
Java class java.lang.String, and Java type class java.lang.String, and MIME
media type application/json was not found
at
com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:630)
...
SEVERE: The registered message body readers compatible with the MIME media type
are:
application/json ->
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App ...
(Note: StringProvider is missing from this list)
{code}
This could prevent the Kudu Master from ever receiving authorized policies from
Ranger, leading to {{Not Authorized}} errors (403) for legitimate user requests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)