Visitar URL original
Illegal access to msgpack.core.buffer.DirectBufferAccess · Issue #452 · tarantool/cartridge-java · GitHub
Skip to content

Illegal access to msgpack.core.buffer.DirectBufferAccess #452

Description

@ArtDu
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.msgpack.core.buffer.DirectBufferAccess (file:/home/centos/cartridge-java/IyaRbn1BID/.m2/repository/org/msgpack/msgpack-core/0.9.6/msgpack-core-0.9.6.jar) to constructor java.nio.DirectByteBuffer(long,int,java.lang.Object)
WARNING: Please consider reporting this to the maintainers of org.msgpack.core.buffer.DirectBufferAccess
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@akudiyar After #438 I'll get this message when I run client with eval requests

Activity

  1. akudiyar commented on Jan 2, 2024

    @akudiyar
    Collaborator

    First of all, it is not a bug, it is a warning specific to JDK 17+. See the related issues:

    And this warning should have been already mitigated by the commit 14e051a. So I need a bit more details about the Java version and the build steps.

    This warning is not shown on 1.8 (see the last CI check results for example).

  2. removed
    bugSomething isn't working
    on Jan 3, 2024
  3. ArtDu commented on Jan 3, 2024

    @ArtDu
    ContributorAuthor

    And this warning should have been already mitigated by the commit 14e051a

    But in warning we can see that msgpack-core-0.9.6 is used.

    WARNING: Illegal reflective access by org.msgpack.core.buffer.DirectBufferAccess (file:/Users/artyom.dubinin/.m2/repository/org/msgpack/msgpack-core/0.9.6/msgpack-core-0.9.6.jar) to constructor java.nio.DirectByteBuffer(long,int,java.lang.Object)
    

    So I need a bit more details about the Java version and the build steps.

    I ran it on jdk 11

    $ JAVA_HOME=~/Library/Java/JavaVirtualMachines/corretto-11.0.13/Contents/Home mvn exec:java -Dexec.mainClass="io.tarantool.driver.Test"
    
    Running `/Users/artyom.dubinin/tarantool/cartridge-java/mvnw`...
    [INFO] Scanning for projects...
    [INFO] Inspecting build with total of 1 modules...
    [INFO] Installing Nexus Staging features:
    [INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
    [INFO]
    [INFO] -------------------< io.tarantool:cartridge-driver >--------------------
    [INFO] Building Java driver for Tarantool Cartridge 1.0.0-SNAPSHOT
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO]
    [INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ cartridge-driver ---
    18:40:57.062 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
    18:40:57.068 [io.tarantool.driver.Test.main()] DEBUG io.netty.channel.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 16
    18:40:57.074 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.concurrent.GlobalEventExecutor - -Dio.netty.globalEventExecutor.quietPeriodSeconds: 1
    18:40:57.081 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
    18:40:57.081 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
    18:40:57.100 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
    18:40:57.100 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 11
    18:40:57.101 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
    18:40:57.102 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
    18:40:57.102 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.storeFence: available
    18:40:57.102 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
    18:40:57.103 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable: Reflective setAccessible(true) disabled
    18:40:57.103 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
    18:40:57.105 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable: class io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @7f9b89d0
    18:40:57.107 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, {int,long}): unavailable
    18:40:57.107 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available
    18:40:57.107 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: /var/folders/yp/ymwg4wxs381bmvgjp70khxy40000gp/T (java.io.tmpdir)
    18:40:57.107 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
    18:40:57.107 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent - Platform: MacOS
    18:40:57.108 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: -1 bytes
    18:40:57.108 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
    18:40:57.109 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.CleanerJava9 - java.nio.ByteBuffer.cleaner(): available
    18:40:57.109 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
    18:40:57.109 [io.tarantool.driver.Test.main()] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
    18:40:57.110 [io.tarantool.driver.Test.main()] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
    18:40:57.116 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available
    18:40:57.182 [io.tarantool.driver.Test.main()] DEBUG io.tarantool.driver.core.connection.AbstractTarantoolConnectionManager - Current connection mode: FULL
    18:40:57.205 [io.tarantool.driver.Test.main()] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 99345 (auto-detected)
    18:40:57.210 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
    18:40:57.210 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
    18:40:57.216 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.NetUtilInitializations - Loopback interface: lo0 (lo0, 0:0:0:0:0:0:0:1%lo0)
    18:40:57.217 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file /proc/sys/net/core/somaxconn. Default: 128
    18:40:57.219 [io.tarantool.driver.Test.main()] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: ac:de:48:ff:fe:00:11:22 (auto-detected)
    18:40:57.228 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
    18:40:57.229 [io.tarantool.driver.Test.main()] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4
    18:40:57.249 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 16
    18:40:57.249 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 16
    18:40:57.249 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
    18:40:57.249 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 9
    18:40:57.249 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 4194304
    18:40:57.249 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
    18:40:57.249 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
    18:40:57.249 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
    18:40:57.250 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
    18:40:57.250 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimIntervalMillis: 0
    18:40:57.250 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: false
    18:40:57.250 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
    18:40:57.259 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
    18:40:57.259 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 0
    18:40:57.259 [io.tarantool.driver.Test.main()] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
    18:40:57.266 [io.tarantool.driver.Test.main()] DEBUG io.netty.bootstrap.ChannelInitializerExtensions - -Dio.netty.bootstrap.extensions: null
    18:40:57.324 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 4096
    18:40:57.324 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.ratio: 8
    18:40:57.324 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.chunkSize: 32
    18:40:57.324 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.blocking: false
    18:40:57.324 [nioEventLoopGroup-2-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.batchFastThreadLocalOnly: true
    18:40:57.329 [nioEventLoopGroup-2-1] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkAccessible: true
    18:40:57.330 [nioEventLoopGroup-2-1] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkBounds: true
    18:40:57.330 [nioEventLoopGroup-2-1] DEBUG io.netty.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@29861931
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.msgpack.core.buffer.DirectBufferAccess (file:/Users/artyom.dubinin/.m2/repository/org/msgpack/msgpack-core/0.9.6/msgpack-core-0.9.6.jar) to constructor java.nio.DirectByteBuffer(long,int,java.lang.Object)
    WARNING: Please consider reporting this to the maintainers of org.msgpack.core.buffer.DirectBufferAccess
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    18:40:57.361 [nioEventLoopGroup-2-1] INFO io.tarantool.driver.core.connection.AbstractTarantoolConnectionManager - Connected to Tarantool server at localhost/127.0.0.1:3301
    18:40:57.370 [nioEventLoopGroup-2-1] DEBUG io.tarantool.driver.api.connection.TarantoolConnection - Request 1 sent, status Success
    hello
    package io.tarantool.driver;
    
    import io.tarantool.driver.api.TarantoolClient;
    import io.tarantool.driver.api.TarantoolClientFactory;
    import io.tarantool.driver.api.TarantoolResult;
    import io.tarantool.driver.api.tuple.TarantoolTuple;
    
    public class Test {
        private static TarantoolClient<TarantoolTuple, TarantoolResult<TarantoolTuple>> getClient(Integer connections) {
            return TarantoolClientFactory.createClient()
                .withAddress("localhost", 3301)
                .withConnections(connections)
                .withConnectTimeout(3000)
                .build();
        }
    
        public static void main(String[] args) throws Exception {
            TarantoolClient<TarantoolTuple, TarantoolResult<TarantoolTuple>> client = getClient(1);
            client.eval("return 1").join();
            System.out.println("hello");
        }
    }

    This warning is not shown on 1.8 (see the last CI check results for example).

    You are right, it doesn't happen on 1.8

  4. dkasimovskiy commented on Jan 19, 2024

    @dkasimovskiy
    Contributor

    Not a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions