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

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by Steve Hummingbird,
  • 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.
    via by Steve Hummingbird,
    • 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)
    No Bugmate found.