InaccessibleObjectException - Unable to make field private static final long java.util.ArrayList.serialVersionUID accessible

See original GitHub issue

Version

bot-integration-spring:4.14.2

Describe the bug

When continuing a conversation I get an InaccessibleObjectException on openjdk17

To Reproduce

Steps to reproduce the behavior:

private final BotFrameworkHttpAdapter adapter;

adapter.continueConversation(...)
java.util.concurrent.CompletionException: java.lang.reflect.InaccessibleObjectException: Unable to make field private static final long java.util.ArrayList.serialVersionUID accessible: module java.base does not "opens java.util" to unnamed module @7c30a502
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private static final long java.util.ArrayList.serialVersionUID accessible: module java.base does not "opens java.util" to unnamed module @7c30a502
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at com.microsoft.bot.restclient.Validator.validateClass(Validator.java:73)
at com.microsoft.bot.restclient.Validator.validate(Validator.java:60)
at com.microsoft.bot.restclient.Validator.validateClass(Validator.java:107)
at com.microsoft.bot.restclient.Validator.validate(Validator.java:60)
at com.microsoft.bot.restclient.Validator.validateClass(Validator.java:100)
at com.microsoft.bot.restclient.Validator.validate(Validator.java:60)
at com.microsoft.bot.connector.rest.RestConversations.replyToActivity(RestConversations.java:458)
at com.microsoft.bot.connector.Conversations.replyToActivity(Conversations.java:202)
at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$sendActivities$5(BotFrameworkAdapter.java:618)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)

Expected behavior

It should just work

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Running on openjdk-17 on docker with alpine image

https://openjdk.org/jeps/403

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
johnmirokicommented, Jun 30, 2022

I forgot how but I ran into the same problem, a quick fix is to add this VM option: –add-opens java.base/java.util=ALL-UNNAMED

0reactions
esfomeadocommented, Jun 30, 2022

@johnmiroki Thanks, that’s what I’m using as well as workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to make field private final java.util.Comparator ...
I solved my problem. Turns out the JRE that eclipse had automatically downloaded and was using wasn't compatible with this version of ...
Read more >
java.lang.reflect.InaccessibleObjectException: Unable to ...
Java.lang.reflect.InaccessibleObjectException: Unable to make field private final int java.time.LocalDate.year accessible: module java.base ...
Read more >
Unable to make field private java.lang.Throwable - Bugs
InaccessibleObjectException : Unable to make field private java.lang.Throwable java.lang.Throwable.cause accessible: module java.base does not "opens ...
Read more >
Java 9 Compiler: Unable to make field private static final jdk ...
Trying to compile the Junit5 project with gradle as part of this PR: This is running with kotlin version 1.1.3-2 . I'm not...
Read more >
Fix 'Unable make field private final java.util ... - YouTube
Cucumber #Selenium #Appium #RestAssured #Automation#Error message #ExceptionInInitializerError # java. util.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found