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

Corda序列化白名单未更新求助:java.util.Date仍触发序列化报错

Troubleshooting Corda Serialization Whitelist Issue with java.util.Date

Let me break down the likely issues you’re facing— I’ve dealt with similar Corda serialization whitelist headaches before, so here’s what to check:

1. Ensure Your Whitelist Class Lives in a CorDapp Module

Corda generates whitelists per CorDapp, not for external API modules like your Springboot RPC server. If your RequiredSerializationWhitelist is located in your Springboot API project (separate from your contracts/workflows CorDapp modules), the node will never scan or process it.

  • Move the RequiredSerializationWhitelist class into your existing CorDapp module (either the contracts or workflows module— whichever makes sense for your project) alongside your Contracts class.
  • Verify that this module is being packaged as a CorDapp JAR and deployed to your node.

2. Double-Check the META-INF/services Configuration

It’s easy to misconfigure the service provider file, which is critical for Corda to detect your whitelist:

  • Path accuracy: Make sure the file is at src/main/resources/META-INF/services/net.corda.core.serialization.SerializationWhitelist (exact path and filename— no typos).
  • Full class name: The file’s content must be the fully qualified name of your whitelist class: com.p2p.RequiredSerializationWhitelist. Check for typos in package names, class names, or capitalization.
  • Resource location: Ensure this META-INF/services directory is inside the CorDapp module’s resources folder, not your Springboot API’s resources.

3. Verify Node Logs for CorDapp Loading

Check your node’s startup logs to confirm it’s actually loading the CorDapp that contains your whitelist class. Look for lines like:

Loaded CorDapp com.p2p:your-cordapp-module-name:1.0

If you don’t see this line, your CorDapp module isn’t being deployed correctly. Double-check your nodes.conf file to ensure the CorDapp JAR path is specified, or that the module is included in your node build process (e.g., via the Corda Gradle plugin).

4. Confirm Corda Version Compatibility

Your SerializationWhitelist implementation looks correct for most Corda versions (4.x+), but if you’re on an older version, there might be subtle changes:

  • Ensure you’re importing the correct package: import net.corda.core.serialization.SerializationWhitelist (no misspelled package names).
  • If you’re using Corda 5, the serialization system has changed significantly— but your error message suggests you’re on an older version (since 5 uses different error wording).

5. Temporary Workaround (For Testing)

If you need to validate the root cause quickly, you can manually add java.util.Date to the generated whitelist.txt file and restart your node. This should resolve the serialization error temporarily, but note that this file will be overwritten every time you redeploy your nodes. Use this to confirm that the whitelist is indeed the issue, then fix the underlying configuration.

Why Your whitelist.txt Only Contains Contracts Classes

Corda automatically adds all contract classes from deployed CorDapps to the whitelist by default. Since your custom whitelist class isn’t being detected by the node, it’s not adding java.util.Date to the generated list. Fixing the above steps should ensure your whitelist entries are included.

内容的提问来源于stack exchange,提问作者Karan Kulwal

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.12 05:24:37