On Tue, Dec 10, 2024 at 1:01 PM Rainer Jung <rainer.j...@kippdata.de> wrote: > > Am 12.09.24 um 16:15 schrieb Rémy Maucherat: > > This JEP has the potential to have a significant impact with Tomcat's > > JNI use starting with Java 26. > > https://openjdk.org/jeps/471 > > > > Unsafe.invokeCleaner will be removed, which will effectively prevent > > using the direct ByteBuffers that are needed for tomcat-native. The > > solution is to use a memory segment from FFM, then call > > MemorySegment.asByteBuffer, which creates a direct ByteBuffer with a > > controllable lifecycle. So using JNI would require FFM and using the > > full FFM code instead should make more sense. > > Recent Java 24 EA now issues: > > WARNING: A terminally deprecated method in sun.misc.Unsafe has been called > WARNING: sun.misc.Unsafe::invokeCleaner has been called by > org.apache.tomcat.util.buf.ByteBufferUtils (file:/.../lib/tomcat-util.jar) > WARNING: Please consider reporting this to the maintainers of class > org.apache.tomcat.util.buf.ByteBufferUtils > WARNING: sun.misc.Unsafe::invokeCleaner will be removed in a future release
Ok, so: - Don't enable direct buffers on the connectors. This is not the default so it should be fine. Eventually that feature would have to be removed. Maybe as soon as Tomcat 12. - If using Java 24+, use FFM instead of tomcat-native (since tomcat-native needs some direct byte buffers). This seems to work. It would of course be a lot more comfortable if FFM was in Java 21. Rémy --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org