Debug GWT RPC Payloads With VM Arguments
GWT RPC serialises Java objects into a compact wire format. When requests fail or exceed the 1 MB default size, you need visibility into the payload to understand which fields misbehave.
Enable Payload Logging
Add the following VM argument to your DevMode or application server startup script:
-Dgwt.rpc.dumpPayload=true
The flag instructs GWT to write each encoded request and response to the log directory (defaults to your working directory). Pair it with -Dgwt.rpc.dumpPayload.limit=10240
to control how many bytes are captured per message.
Troubleshooting Tips
- Obfuscation or compression may still hide field names; enable the
pretty
flag in your logging formatter if available. - When payloads contain unexpected nulls, confirm the affected DTO implements
IsSerializable
or has a zero-arg constructor. - For production incidents, disable the flag immediately after diagnosis to avoid logging sensitive data.