Corda-无法初始化主类胶囊(引起原因:java.lang.NoClassDefFoundError:java / lang / instrument / Instrumentation)

二元

我正在尝试浏览Corda Hello世界示例(特别是Java版本)。
我到了应该部署节点的地步,但是失败了:

> ./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

PartyA和Notary日志中也存在相同的错误。

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

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

> 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)
二元

看来我的环境有问题。
重新安装Java后,问题消失了。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章