java.lang.IllegalAccessError: tried to access class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1$1 from class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1

JIRA | Steve Hummingbird | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I have a groovy class, which runs in vert.x that makes use of the java driver: {code} final EventBus eb final Container container final Logger logger final MongoClient mongo final MongoDatabase db public Service(EventBus eb, Container container) { this.eb = eb this.container = container logger = container.logger mongo = MongoClients.create(new MongoClientURI('mongodb://localhost:27017'), MongoClientOptions.builder().build()) logger.info('got mongo client: ' + mongo) db = mongo.getDatabase('mydb') logger.info('got db: ' + db) } public void terminate() { mongo.close() } {code} In case vert.x redeploys the module containing this class I see the following exception: {code} got mongo client: org.mongodb.async.MongoClientImpl@6e16e721 got db: org.mongodb.async.MongoDatabaseImpl@169e0757 Exception in thread "Thread-6" java.lang.IllegalAccessError: tried to access class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1$1 from class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1 at org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1.completed(AsynchronousSocketChannelStream.java:183) at org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1.completed(AsynchronousSocketChannelStream.java:180) at org.mongodb.connection.AsynchronousSocketChannelStream$2.completed(AsynchronousSocketChannelStream.java:140) at org.mongodb.connection.AsynchronousSocketChannelStream$2.completed(AsynchronousSocketChannelStream.java:137) at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:278) at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198) at sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213) at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:301) at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {code} I have not seen this error when using the synchronous driver. It only showed up when using the async driver.

    JIRA | 3 years ago | Steve Hummingbird
    java.lang.IllegalAccessError: tried to access class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1$1 from class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1
  2. 0

    I have a groovy class, which runs in vert.x that makes use of the java driver: {code} final EventBus eb final Container container final Logger logger final MongoClient mongo final MongoDatabase db public Service(EventBus eb, Container container) { this.eb = eb this.container = container logger = container.logger mongo = MongoClients.create(new MongoClientURI('mongodb://localhost:27017'), MongoClientOptions.builder().build()) logger.info('got mongo client: ' + mongo) db = mongo.getDatabase('mydb') logger.info('got db: ' + db) } public void terminate() { mongo.close() } {code} In case vert.x redeploys the module containing this class I see the following exception: {code} got mongo client: org.mongodb.async.MongoClientImpl@6e16e721 got db: org.mongodb.async.MongoDatabaseImpl@169e0757 Exception in thread "Thread-6" java.lang.IllegalAccessError: tried to access class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1$1 from class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1 at org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1.completed(AsynchronousSocketChannelStream.java:183) at org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1.completed(AsynchronousSocketChannelStream.java:180) at org.mongodb.connection.AsynchronousSocketChannelStream$2.completed(AsynchronousSocketChannelStream.java:140) at org.mongodb.connection.AsynchronousSocketChannelStream$2.completed(AsynchronousSocketChannelStream.java:137) at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:278) at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198) at sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213) at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:301) at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {code} I have not seen this error when using the synchronous driver. It only showed up when using the async driver.

    JIRA | 3 years ago | Steve Hummingbird
    java.lang.IllegalAccessError: tried to access class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1$1 from class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1

    Root Cause Analysis

    1. java.lang.IllegalAccessError

      tried to access class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1$1 from class org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1

      at org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1.completed()
    2. org.mongodb.connection
      AsynchronousSocketChannelStream$2.completed
      1. org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1.completed(AsynchronousSocketChannelStream.java:183)
      2. org.mongodb.connection.AsynchronousSocketChannelStream$AsyncWritableByteChannelAdapter$1.completed(AsynchronousSocketChannelStream.java:180)
      3. org.mongodb.connection.AsynchronousSocketChannelStream$2.completed(AsynchronousSocketChannelStream.java:140)
      4. org.mongodb.connection.AsynchronousSocketChannelStream$2.completed(AsynchronousSocketChannelStream.java:137)
      4 frames
    3. Java RT
      Thread.run
      1. sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      2. sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:278)
      3. sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198)
      4. sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213)
      5. sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:301)
      6. sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
      7. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      8. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      9. java.lang.Thread.run(Thread.java:745)
      9 frames