erghjmncq6643981 commented on issue #5068:
URL: https://github.com/apache/rocketmq/issues/5068#issuecomment-1249036004

   我在使用rocketmq-client时也发现了这个问题,debug错误如下所示:
   
![image](https://user-images.githubusercontent.com/28293807/190585208-c07fd116-40a5-45f9-baad-1cc2fee5a539.png)
   错误产生的原因是,由于rocketmq是在JDK17的环境中进行构建的:
   ![截屏2022-09-14 15 12 
50](https://user-images.githubusercontent.com/28293807/190584711-589a3a62-467a-463f-bbcb-3b777d94b6f9.png)
   解决方法:降低版本,或者自己在低版本jdk中构建
   相关信息如下所示:
   In Java 8, while calling flip() method of ByteBuffer class, since it has no 
implementation for this method, so it is actually calling the method from 
extended class, Buffer; which is returning Buffer object as below:
   
   In Buffer class:
   
   ```
   public final Buffer flip() {
       limit = position;
       position = 0;
       mark = -1;
       return this;
   }
   ```
   However, in Java 11, ByteBuffer class has implemented its own flip() method, 
and the returning object is changed from Buffer to ByteBuffer (This change 
should be started from Java 9):
   
   In ByteBuffer class:
   
   `ByteBuffer flip() {
       super.flip();
       return this;
   }`
   
   
   
   


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