gpt4 book ai didi

java - Corda - 无法初始化主类 Capsule(由 : java. lang.NoClassDefFoundError: java/lang/instrument/Instrumentation 引起)

转载 作者:太空宇宙 更新时间:2023-11-04 10:10:36 27 4
gpt4 key购买 nike

我正在尝试通过 Corda Hello world example (特别是 Java 版本)。
我已经到了 nodes should be deployed但这失败了:

> ./gradlew clean deployNodes                    

> Configure project :
Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0
at build_9ngc7dap6wdyi5igmry41f6s9$_run_closure5.doCall(/home/foo/cordapp-template-java/build.gradle:85)
The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
at build_9ngc7dap6wdyi5igmry41f6s9$_run_closure5.doCall(/home/foo/cordapp-template-java/build.gradle:85)

> Task :deployNodes
Bootstrapping local network in /home/foo/cordapp-template-java/build/nodes
Node config files found in the root directory - generating node directories
Generating directory for Notary
Generating directory for PartyA
Generating directory for PartyB
Nodes found in the following sub-directories: [PartyB, PartyA, Notary]
Waiting for all nodes to generate their node-info files...


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':deployNodes'.
> Node in PartyB exited with 1 when generating its node-info - see logs in /home/foo/cordapp-template-java/build/nodes/PartyB/logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
15 actionable tasks: 15 executed

建议我查看 /home/foo/cordapp-template-java/build/nodes/PartyB/logs 中的日志,其中包含文件 node-info-gen.log 以下内容:

Error: Unable to initialize main class Capsule
Caused by: java.lang.NoClassDefFoundError: java/lang/instrument/Instrumentation

甲方和公证人日志中也出现同样的错误。

导致此错误的原因可能是什么?

为了确保我没有意外添加导致此问题的更改,我删除了更改并按原样使用模板项目:

> git status       
On branch release-V3
Your branch is up-to-date with 'origin/release-V3'.
nothing to commit, working directory clean

> git branch -v
* release-V3 c9eed90 Reducing dependency on Jitpack by depending on new repository that is a combination of corda-releases and corda-dependencies (#37)

我的环境

> java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial

我也尝试过使用 Oracle JDK,但得到了完全相同的结果。

> /usr/lib/jvm/java-8-oracle/bin/java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

最佳答案

在运行deployNodes时,我认为你不应该运行clean任务。

1. ./gradlew clean build
2../gradlew deployNodes

应该可以。

关于java - Corda - 无法初始化主类 Capsule(由 : java. lang.NoClassDefFoundError: java/lang/instrument/Instrumentation 引起),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52388867/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com