Illegal reflective access in RPC serializer

60 views
Skip to first unread message

Samuel Padou

unread,
Oct 30, 2023, 2:44:17 PM10/30/23
to GWT Users
Hi,

Working with Java 21 I have some issues with RPC serializer causing illegal reflective access in LinkedHashMap_CustomFieldSerializer.

I see that this has been fixed in https://github.com/gwtproject/gwt/issues/9584 but the fix is not included in the 2.10 release as far as I can see.

The workaround is to use --add-opens but this basically open the full java.util package for reflection which is not ideal. I also tried to replace the custom serializer, but due to the way custom serializers are loaded (using the exact package name), this doesn't seems possible without compiling a custom jar.

Is there any plan to make a release that include the fix for this issue, either 2.11 or a path of the 2.10?

Jens

unread,
Nov 2, 2023, 5:43:03 AM11/2/23
to GWT Users
The workaround is to use --add-opens but this basically open the full java.util package for reflection which is not ideal. I also tried to replace the custom serializer, but due to the way custom serializers are loaded (using the exact package name), this doesn't seems possible without compiling a custom jar.

You can copy the file and put it into your source directory. However you must also make sure that the serializer is deployed on server side and not only compiled to JavaScript. Serializers supplied by GWT are in gwt-user.jar (for JS compilation) and in gwt-servlet.jar (server). The easiest solution is to fork GWT itself, apply the patch and build your own GWT SDK for now.

 There is a plan to release 2.11 but no concrete time frame: https://groups.google.com/g/google-web-toolkit-contributors/c/JfIAPN6XFCo

-- J.
Reply all
Reply to author
Forward
0 new messages