newur opened a new pull request #10983:
URL: https://github.com/apache/pulsar/pull/10983


   ### Motivation
   
   Java client fails with `Java 16` while receiving a message. Error:
   
   ```
   [org.apa.pul.cli.imp.ClientCnx] (pulsar-client-io-2-1) 
[localhost/127.0.0.1:6650] Got exception java.lang.NoClassDefFoundError: Could 
not initialize class io.airlift.compress.lz4.UnsafeUtil
        at 
io.airlift.compress.lz4.Lz4RawDecompressor.decompress(Lz4RawDecompressor.java:60)
        at 
org.apache.pulsar.common.compression.CompressionCodecLZ4.decode(CompressionCodecLZ4.java:91)
        at 
org.apache.pulsar.client.impl.ConsumerImpl.uncompressPayloadIfNeeded(ConsumerImpl.java:1507)
        at 
org.apache.pulsar.client.impl.ConsumerImpl.messageReceived(ConsumerImpl.java:1037)
        at 
org.apache.pulsar.client.impl.ClientCnx.handleMessage(ClientCnx.java:447)
        at 
org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:186)
   ...
   ```
   
   Can be reproduced with the official example for Java Client from the docu 
while using JDK 16.
   
   ### Modifications
   
   Upgrade io.airlift.aircompressor to version 16. Locally I use 
`pulsar-client-original`, and exclude the aircompressor 16. Example:
   
   ```
   <dependency>
     <groupId>org.apache.pulsar</groupId>
     <artifactId>pulsar-client-original</artifactId>
     <version>${pulsar.version}</version>
     <exclusions>
       <exclusion>
         <groupId>io.airlift</groupId>
         <artifactId>aircompressor</artifactId>
       </exclusion>
     </exclusions>
   </dependency>
   
   <!-- https://mvnrepository.com/artifact/io.airlift/aircompressor -->
   <dependency>
     <groupId>io.airlift</groupId>
     <artifactId>aircompressor</artifactId>
     <version>0.16</version>
   </dependency>
   ```
   
     - *Dependencies* yes upgrade


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to