JetBrains / intellij-ui-test-robot

The library allows you to write and execute UI tests among IntelliJ IDEA. You can test your Plugin.

Home Page:https://jetbrains-platform.slack.com/archives/C026SVA9MMM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Unable to create converter for class com.intellij.remoterobot.client.RetrieveResponse" on JDK17

JohnLBergqvist opened this issue · comments

Hi, when starting the robot server (which i've confirmed is activate the correct URL), and calling remoteRobot.getOs();, I get the following exception (when built using JDK17):

java.lang.IllegalArgumentException: Unable to create converter for class com.intellij.remoterobot.client.RetrieveResponse
    for method IdeRobotApi.retrieve
	at retrofit2.Utils.methodError(Utils.java:54)
	at retrofit2.HttpServiceMethod.createResponseConverter(HttpServiceMethod.java:126)
	at retrofit2.HttpServiceMethod.parseAnnotations(HttpServiceMethod.java:85)
	at retrofit2.ServiceMethod.parseAnnotations(ServiceMethod.java:39)
	at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:202)
	at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
	at jdk.proxy2/jdk.proxy2.$Proxy12.retrieve(Unknown Source)
	at com.intellij.remoterobot.client.IdeRobotClient.retrieve(IdeRobotClient.kt:75)
	at com.intellij.remoterobot.JavaScriptApi$DefaultImpls.callJs(JavaScriptApi.kt:78)
	at com.intellij.remoterobot.RemoteRobot.callJs(RemoteRobot.kt:32)
	at com.intellij.remoterobot.JavaScriptApi$DefaultImpls.callJs(JavaScriptApi.kt:67)
	at com.intellij.remoterobot.RemoteRobot.callJs(RemoteRobot.kt:32)
	at com.intellij.remoterobot.RemoteRobot.getOs(RemoteRobot.kt:68)

When using JDK11, this does not occur.

I'm using v0.11.20 of com.intellij.remoterobot.remote-robot

Hi, try to pass jvm arg --add-opens java.base/java.lang=ALL-UNNAMED to the test task

Hi, try to pass jvm arg --add-opens java.base/java.lang=ALL-UNNAMED to the test task

I've just tried this, but unfortunately it's had no effect.

I've got more of a stacktrace though, so I think you're on the right lines, but i've definitely applied that argument to the test task (there's already a similar --add-opens on java.io in the build.gradle file i'm using.

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private java.lang.String java.lang.Throwable.detailMessage accessible: module java.base does not "opens java.lang" to unnamed module @2fd6ffa9
	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.google.gson.internal.reflect.UnsafeReflectionAccessor.makeAccessible(UnsafeReflectionAccessor.java:44)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:159)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
	at com.google.gson.Gson.getAdapter(Gson.java:489)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:117)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:166)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:102)
	at com.google.gson.Gson.getAdapter(Gson.java:489)
	at retrofit2.converter.gson.GsonConverterFactory.responseBodyConverter(GsonConverterFactory.java:64)
	at retrofit2.Retrofit.nextResponseBodyConverter(Retrofit.java:362)
	at retrofit2.Retrofit.responseBodyConverter(Retrofit.java:345)
	at retrofit2.HttpServiceMethod.createResponseConverter(HttpServiceMethod.java:124)

Could you please share some details about how to reproduce the issue? --add-opens java.base/java.lang=ALL-UNNAMED works in my case