Cybersource-rest-client-java failure under Java 17
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
Bắt đầu tại dòng ghi nhật ký debug trong ApiClient.execute gọi json.serialize(response.headers()), sau đó lần theo lỗi được báo cáo qua Invokers.JSON.serialize. Tái hiện một lệnh gọi API trên Java 17 và xác minh rằng việc ghi nhật ký response không còn gây ra exception về quyền truy cập phản chiếu của Gson, trong khi request vẫn hoàn tất thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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,
- Ngôn ngữ chính
- Java
- Star
- 29
- Fork
- 50
- Merge trung bình
- 1 giờ 30 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CyberSource/cybersource-rest-client-java
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
CyberSource/cybersource-rest-client-java#241 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
CyberSource/cybersource-rest-client-java#235 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Tất cả issue của CyberSource/cybersource-rest-client-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/rocketmq-dashboard#6872 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ADORSYS-GIS/token-status-link#168 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ADORSYS-GIS/keycloak-oid4vp-plugin#232 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Wrong link to test resultsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
docs(site): Mermaid edge-label contrast on Architecture and a table header on How it comparesĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
devops-thiago/ThrillhouseBot#1132 ·
Maintainer thường phản hồi trong vòng 1 ngày