Using rpc.XserializeFinalFields

51 views
Skip to first unread message

Gerard Keiser

unread,
Jul 10, 2025, 9:54:20 AMJul 10
to GWT Users
I noticed there were many warnings about adding the experimental rpc.XserializeFinalFields flag (https://github.com/gwtproject/gwt/issues/1062). Is there anything I should be looking out for if I try this?

(Yes, I would prefer to just use Jackson, but that is a much larger migration effort.)

Tim Macpherson

unread,
Jul 10, 2025, 1:21:51 PMJul 10
to google-we...@googlegroups.com
I recently migrated from rpc to Domino Jackson. 

If your DTO classes are well formed it's not difficult - so far,  not completely tested 


On Thu, Jul 10, 2025 at 2:54 PM, 'Gerard Keiser' via GWT Users
I noticed there were many warnings about adding the experimental it's not rpc.XserializeFinalFields flag (https://github.com/gwtproject/gwt/issues/1062). Is there anything I should be looking out for if I try this?

(Yes, I would prefer to just use Jackson, but that is a much larger migration effort.)

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/144a69f5-29a0-4846-8e0f-6d1782becb2en%40googlegroups.com.

Colin Alworth

unread,
Jul 10, 2025, 2:22:27 PMJul 10
to GWT Users
If your DTO classes care about specific collection implementations, or want maps with complex keys, or want to serialize non-tree graphs (so the same object can appear more than once when it gets to the client), JSON might add extra hurdles.

The final field serialization feature was added a long time ago, and I don't think I've seen any issues come up since it was first added.  Brian's comment near the end of that ticket still applies - it probably isn't safe to assume for general purpose libraries, but if you own the application as well, it should be safe to use.

Tim Macpherson

unread,
Jul 11, 2025, 12:08:26 PMJul 11
to google-we...@googlegroups.com
My DTOs had some circular references which were permissable for rpc but not for Jackson.
So far no other problems.

Gerard Keiser

unread,
Jul 11, 2025, 2:44:52 PMJul 11
to GWT Users
Thanks for the responses. The biggest thing, I suppose, is JPMS, especially since Java 17, which I have not yet had a need to learn much about. Am I setting myself up for reflection exceptions in unpredictable places, as suggested at https://docs.oracle.com/en/java/javase/17/migrate/migrating-jdk-8-later-jdk-releases.html#GUID-7BB28E4D-99B3-4078-BDC4-FC24180CE82B and https://github.com/gwtproject/gwt/issues/9793? If so, is there a good workaround? And after digging further, I found a proposal at https://openjdk.org/jeps/8349536 to disallow the final field modification used by the deserializer (https://github.com/gwtproject/gwt/blob/498c127d78e24e0768f50f16afdb0040e4317ea3/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamReader.java#L851). So maybe this is a bad idea in the long-term unless the deserializer is able to be switched to using ReflectionFactory.

And unfortunately, the DTOs really are quite messy to use with Jackson.

Reply all
Reply to author
Forward
0 new messages