Cybersource-rest-client-java failure under Java 17
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 50/100
Research direction
Start at the debug logging line in ApiClient.execute that calls json.serialize(response.headers()), then trace the reported failure through Invokers.JSON.serialize. Reproduce an API call under Java 17 and verify that response logging no longer triggers the Gson reflective-access exception while the request still completes successfully.
Written by the indexing model from the issue text.
Description
We use the cybersource-rest-client-java library for making merchant payments. Our code runs successfully under Java 11.
Porting to Java 17, we see the following failure when making API calls -
com.google.gson.JsonIOException: Failed making field 'java.io.Reader#lock' accessible; either change its visibility or write a custom TypeAdapter for its declaring type
at com.google.gson.internal.reflect.ReflectionHelper.makeAccessible(ReflectionHelper.java:23)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:203)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:112)
at com.google.gson.Gson.getAdapter(Gson.java:531)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:137)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:211)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:112)
at com.google.gson.Gson.getAdapter(Gson.java:531)
at com.google.gson.Gson.toJson(Gson.java:778)
at com.google.gson.Gson.toJson(Gson.java:756)
at com.google.gson.Gson.toJson(Gson.java:711)
at com.google.gson.Gson.toJson(Gson.java:691)
at Invokers.JSON.serialize(JSON.java:83)
at Invokers.ApiClient.execute(ApiClient.java:1204)
at Api.PaymentsApi.createPaymentWithHttpInfo(PaymentsApi.java:161)
at Api.PaymentsApi.createPayment(PaymentsApi.java:146)
This all seems to come from one single line of debug logging in the ApliClient. execute method -
logger.debug("Network Response :\n" + json.serialize(response.headers()));
The response object here is an OK HTTP object, with Java IO members that do not work for this reflective serialization under Java 17
I have built my own copy of the library with this one line removed, and the code works for me under Java 17,
- Dominant language
- Java
- Stars
- 29
- Forks
- 50
- Avg merge
- 28m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CyberSource/cybersource-rest-client-java
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
CyberSource/cybersource-rest-client-java#241 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
CyberSource/cybersource-rest-client-java#235 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in CyberSource/cybersource-rest-client-java
Similar issues
-
[destination-snowflake] Custom domains rejected unlike source connectionsPossibly taken @kuza55 claimed this today. Openautoteam community connectors/destination/snowflake team/use
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
component/operate kind/feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Forge coverage prompts carry text the agent cannot act onPossibly taken @graalvmbot claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
oracle/graalvm-reachability-metadata#10572 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IBM/sample-app-mod#55 ·