Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

My program is not working, please help. #1179

Unanswered
aglasencnik asked this question in Q&A
Discussion options

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)

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

The same problem has now. Maybe you can remember how you solve this problem?

You must be logged in to vote
2 replies
Comment options

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

Comment options

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /