AXIS2-6104 Bring Moshi JSON-RPC receivers to feature parity with Gson
The Moshi rpc/ package (JsonRpcMessageReceiver, JsonInOnlyRPCMessageReceiver,
JsonUtils) now has identical error handling to the Gson equivalents:
- JsonRpcFaultException detection: unwraps InvocationTargetException,
checks for JsonRpcFaultException, sets HTTP status + structured
Axis2JsonErrorResponse on the outgoing MessageContext
- createSecureFault: new method in moshi JsonUtils with the same
CWE-209-safe opaque errorRef pattern (both 1-arg and 4-arg overloads)
- ITE unwrap: all catch blocks now log the root cause, not the wrapper
The shared classes (Axis2JsonErrorResponse, JsonRpcFaultException,
PaginatedResponse, PaginationRequest) live in gson.rpc and are
referenced by both implementations — they contain no Gson-specific
imports and are serialization-library-agnostic POJOs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 files changed