leizhiyuan opened a new issue, #9779:
URL: https://github.com/apache/rocketmq/issues/9779

   ### Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [x] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [x] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   When dataReadAheadEnable is set to false, there will be problems running on 
higher JDK versions
   
   ```
   java.lang.IllegalAccessError: class org.apache.rocketmq.store.CommitLog (in 
unnamed module @0x3d8314f0) cannot access class sun.nio.ch.DirectBuffer (in 
module java.base) because module java.base does not export sun.nio.ch to 
unnamed module @0x3d8314f0
        at 
org.apache.rocketmq.store.CommitLog.setFileReadMode(CommitLog.java:2484)
        at 
org.apache.rocketmq.store.CommitLog.lambda$scanFileAndSetReadMode$1(CommitLog.java:2472)
        at 
java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891)
        at 
org.apache.rocketmq.store.CommitLog.scanFileAndSetReadMode(CommitLog.java:2471)
        at org.apache.rocketmq.store.CommitLog.load(CommitLog.java:167)
        at 
org.apache.rocketmq.store.DefaultMessageStore.load(DefaultMessageStore.java:397)
        at 
org.apache.rocketmq.broker.BrokerController.recoverAndInitService(BrokerController.java:942)
        at 
org.apache.rocketmq.broker.BrokerController.initialize(BrokerController.java:928)
        at 
org.apache.rocketmq.broker.BrokerStartup.createBrokerController(BrokerStartup.java:322)
        at org.apache.rocketmq.broker.BrokerStartup.main(BrokerStartup.java:58)
   ```
   
   ### RocketMQ version
   
   all
   
   ### JDK Version
   
   jdk21
   
   ### Describe the Bug
   
   use internal api in higher jdk will fail
   
   ### Steps to Reproduce
   
   When dataReadAheadEnable is set to false, there will be problems running on 
higher JDK versions
   
   ### What Did You Expect to See?
   
   run ok
   
   ### What Did You See Instead?
   
   failed
   
   ### Additional Context
   
   change          final long address = ((DirectBuffer) 
mappedFile.getMappedByteBuffer()).address();
   
   to 
   
           final long address = 
PlatformDependent.directBufferAddress(mappedFile.getMappedByteBuffer());
   can fixed


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