Repository navigation
chore(deps): upgrade jsonrpc4j from 1.6 to 1.7 - #7030
Merged
lvs0075 merged 1 commit intoOct 14, 2026
Merged
Conversation
1. bump jsonrpc4j to 1.7, the latest release 2. add jakarta.servlet-api 5.0.0 as a test dependency; jsonrpc4j declares it optional, and Mockito needs it on the classpath to mock JsonRpcServer, whose new handle overload takes jakarta servlet types; the servlet dispatches through handleRequest and never calls that overload 3. drop javax.jws-api; jsonrpc4j 1.7 logs a missing javax.jws.WebParam at debug level instead of error, and no code uses @WebParam 4. accept one wire-level behavior change: when a positional parameter cannot be converted to the declared Java type (for example an object or array where a string is expected), the response changes from -32700 "JSON parse error" with id "null" to -32602 "Failed to read method parameter at index N" with the request id preserved and no data field; this also applies to batch entries, and a request without an id still gets this error with id null; the error is produced inside jsonrpc4j and does not pass through the error resolver 5. transitive changes on the runtime classpath: commons-codec 1.15 -> 1.16.1, httpcore 4.4.13 -> 4.4.16, httpcore-nio 4.4.5 -> 4.4.16, jakarta.jws-api 3.0.0 added, net.iharder:base64 removed; slf4j-api and jackson keep resolving to 2.0.17 and 2.18.10 6. update the dispatch contract test, extend the error integration test with conversion errors in single, batch and id-less requests, and update the dependency verification metadata accordingly
halibobo1205
approved these changes
Oct 13, 2026
317787106
reviewed
Oct 13, 2026
317787106
approved these changes
Oct 13, 2026
Little-Peony
added a commit
to Little-Peony/java-tron
that referenced
this pull request
Oct 14, 2026
* release_v4.8.3: chore(deps): upgrade jsonrpc4j from 1.6 to 1.7 (tronprotocol#7030) fix(config,toolkit): harden keystore, grpc config and build supply chain (tronprotocol#6986)
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Upgrades
com.github.briandilley.jsonrpc4j:jsonrpc4jfrom 1.6 to 1.7, the latest release.framework/build.gradle: bump jsonrpc4j to 1.7; addjakarta.servlet:jakarta.servlet-api:5.0.0as a test-only dependency.build.gradle: removejavax.jws:javax.jws-api:1.1, which was only added as a workaround for jsonrpc4j's@WebParamlookup.gradle/verification-metadata.xml: regenerate the entries for the changed dependencies. This includes metadata-only entries: parent POMs, BOMs, and the Jackson 2.16.1 module files that jsonrpc4j 1.7 requests before conflict resolution selects 2.18.10.JsonRpcDispatchContractTestfor the new conversion error, and extendJsonRpcErrorSanitizationIntegrationTest, which runs a realJsonRpcServerbehindJsonRpcServlet, with conversion-error cases.No production Java code changes.
Why are these changes required?
-32700 "JSON parse error"with"id": "null". The request body is valid JSON, so-32700is the wrong code, and the original id is lost. 1.7 returns-32602with the request id preserved.javax.jwsworkaround. 1.6 logs an error whenjavax.jws.WebParamis missing; 1.7 logs it at debug level. The explicitjavax.jws-apidependency is no longer needed, and no code in the repository uses@WebParam.net.iharder:base64with the JDKBase64and pulls newercommons-codecandhttpcoreversions.Wire-level change
This is the only response change we observed. It applies only to the parameter conversion failure described above:
-32700-32602JSON parse errorFailed to read method parameter at index N"null"(string)"null", 1.7 with -32602 and idnull). This is an existing notification-handling defect; normalization remains deferred to [Feature]Standardize JSON-RPC error handling(revert codes, LiteNode pruned-history responses, request fields validation) #6676.jsonrpcvalue, as resolver-built errors already do; 1.6 always wrote"2.0"on this path.JsonRpcErrorResolver. Neither version logs it above DEBUG.Other error paths (invalid JSON, arity mismatch, missing method, scalar
params, execution errors) keep their current responses. The existing cases for these paths inJsonRpcServletTest,JsonRpcErrorSanitizationIntegrationTestandJsonRpcDispatchContractTestpass with both versions.Classpath changes
Runtime (resolved
frameworkruntimeClasspath, used to buildFullNode.jar):jakarta.jws:jakarta.jws-api3.0.0 added (transitive from jsonrpc4j)net.iharder:base64andjavax.jws:javax.jws-apiremovedTest only:
jakarta.servlet:jakarta.servlet-api5.0.0. jsonrpc4j declares it optional, and Mockito needs it on the classpath to mockJsonRpcServer, which now has a jakartahandleoverload.JsonRpcServletdispatches throughhandleRequestand does not use that overload.This PR has been tested by:
org.tron.core.services.jsonrpc.*andorg.tron.core.jsonrpc.*: 346 tests pass, andcheckstyleTestpasses.JsonRpcErrorSanitizationIntegrationTestcases cover conversion errors in single and batch requests, with and without an id, through a realJsonRpcServerconfigured with the production error resolver. The id-less case uses the same helper as the existing notification-forwarding tests. All three new tests fail when jsonrpc4j is reverted to 1.6; the other cases in the class pass.:framework:testrun: 3396 tests completed, 43 failed, 26 skipped; the build retries a failed test up to 5 times.InetUtilTestcases, each failing on all 6 attempts with stack traces in DNS lookups. They fail the same way (42 failures) on the base commit in the same environment.BackupManagerTest.testInitSkipsDomainResolvingToLocalIp, which timed out after 5 seconds and passed on retry. This is consistent with slow host name resolution in this environment, whereInetAddress.getLocalHost()takes about 5 seconds.-32602, with the request id preserved in single and batch requests and idnullfor id-less requests;javax/jws,net/iharderorjakarta/servletclasses.Follow up
MetricInterceptorreleases its timer only inpostHandle, which jsonrpc4j calls only on the success path. Failed calls, including parameter-conversion failures and exceptions thrown by RPC methods, are not recorded in the latency metric, and the timer stays on the thread until a later request overwrites it. This happens with 1.6 as well and will be fixed separately.Extra details
Upstream changes between 1.6 and 1.7 that do not affect this repository:
JsonRpcFixedParam.RemoteExporter. We do not use the Spring exporter.hasReturnValuehandling for void methods. No JSON-RPC method here returns void.jsonrpc4j 1.7 targets Java 8 bytecode (class version 52).