nodece opened a new pull request, #23886:
URL: https://github.com/apache/pulsar/pull/23886

   ### Motivation
   
   When using the `pulsar-client-all` or `pulsar-admin` libraries, the 
`admin.brokerStats().getLoadReport()` doesn't work:
   
   ```
   DEBUG o.a.p.c.util.ObjectMapperFactory - Add LoadManagerReport deserializer 
failed because LoadManagerReport.class has been shaded
   java.lang.ClassNotFoundException: 
org.apache.pulsar.shade.org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport
   2025-01-23 16:15:16.816 [taskScheduler-9] DEBUG 
o.a.p.c.util.ObjectMapperFactory - Add LoadManagerReport deserializer failed 
because LoadManagerReport.class has been shaded
   java.lang.ClassNotFoundException: 
org.apache.pulsar.shade.org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport
   2025-01-23 16:15:28.232 [http-nio-10000-exec-1] DEBUG 
o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolved 
[org.springframework.web.util.NestedServletException: Handler dispatch failed; 
nested exception is java.lang.AbstractMethodError: Receiver class 
org.apache.pulsar.client.admin.internal.BrokerStatsImpl does not define or 
inherit an implementation of the resolved method 'abstract 
org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport getLoadReport()' 
of interface org.apache.pulsar.client.admin.BrokerStats.]
   ```
   
   We got this error because the shade plugin relocates the 
`org.apache.pulsar.policies.data.loadbalancer.*` package.
   
   ### Modifications
   
   - Exclude `org.apache.pulsar.policies.data.loadbalancer.` package when 
relocating the `org.apache.pulsar.policies` package.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->


-- 
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]

Reply via email to