-
Couldn't load subscription status.
- Fork 528
My program is not working, please help. #1179
-
Hi, I have a problem, maybe you could help me. When I try to make a simple program in Java using Language Translation, i get an exception and a lot of error messages on runtime. My code is the same as in the documentation for listing all languages, (link below) and errors are written below. Also I mad sure my code doesn't have any errors when writting code as well as in pom.xml file. Thanks for any advice.
Link: https://cloud.ibm.com/apidocs/language-translator?code=java#listlanguages
Errors:
Exception in thread "main" 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 @c0edf29 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177) at java.base/java.lang.reflect.Field.setAccessible(Field.java:171) 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:458) 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:458) at com.google.gson.Gson.fromJson(Gson.java:931) at com.ibm.cloud.sdk.core.util.ResponseUtils.getValue(ResponseUtils.java:149) at com.ibm.cloud.sdk.core.util.ResponseConverterUtils6ドル.convert(ResponseConverterUtils.java:137) at com.ibm.cloud.sdk.core.security.TokenRequestBasedAuthenticator2ドル.run(TokenRequestBasedAuthenticator.java:320) at java.base/java.lang.Thread.run(Thread.java:831)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
The same problem has now. Maybe you can remember how you solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @IvMov, yes I just tried a different Java sdk version and it started working, here on github was also an issue opened with the same error.
I think this one is the correct one: #1171
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi, thank you for response, @aglasencnik .
Also find the same fix - I just change jdk version from jdk 18 to jdk 11 and problem gone.
Problem was with using Watson Natural Language Understanding AI from IBM Cloud.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2