You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Corda WebService启动异常:节点启动时RPC分页报错

Fixing Corda Node Startup Error: "Please specify a PageSpecification as there are more results than default page size"

Let me walk you through resolving this issue—it’s a common gotcha with Corda’s RPC vault queries.

What’s causing this error?

The problem is that your node’s Vault contains 201 states, but the vaultTrack RPC call uses a default page size of 200. When you try to track the vault without specifying a custom page size, Corda throws this exception because the result set exceeds the default limit.

How to fix it

You need to explicitly pass a PageSpecification to the vaultTrack method to accommodate the number of states in your Vault. Here’s how to do it in both Kotlin and Java:

Kotlin Example

import net.corda.core.node.services.vault.PageSpecification

// Create a PageSpecification with a page size larger than your total state count
val pageSpec = PageSpecification(pageNumber = 1, pageSize = 1000) // Adjust pageSize as needed

// Pass the pageSpec to vaultTrack
val vaultUpdate = proxy.vaultTrack(YourStateType::class.java, pageSpec = pageSpec)

Java Example

import net.corda.core.node.services.vault.PageSpecification;

// Define your page specification
PageSpecification pageSpec = new PageSpecification(1, 1000); // Set pageSize to a value larger than your state count

// Update the vaultTrack call with the page spec
Vault.Update vaultUpdate = proxy.vaultTrack(YourStateType.class, pageSpec);

Pro Tip

If you’re dealing with a large number of states long-term, avoid setting an extremely large pageSize (like Integer.MAX_VALUE)—this can lead to memory issues. Instead, implement pagination logic to fetch states in smaller batches. But for startup scenarios where you need to load all states at once, just make sure the pageSize is greater than the total number of states in your Vault.

内容的提问来源于stack exchange,提问作者Javier Garcia Lozano

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:22:36