gpt4 book ai didi

java - 如何在代理后面构建java链码

转载 作者:行者123 更新时间:2023-12-02 00:56:26 25 4
gpt4 key购买 nike

有谁知道如何在代理后面构建java链码?在实例化代理后面的 java 链码时,我收到以下错误。

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "Gradle build
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:1.+.
Required by:
project :
> Failed to list versions for org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim.
> Unable to load Maven meta-data from https://repo.maven.apache.org/maven2/org/hyperledger/fabric-chaincode-java/fabric-chaincode-shim/maven-metadata.xml.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/hyperledger/fabric-chaincode-java/fabric-chaincode-shim/maven-metadata.xml'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/hyperledger/fabric-chaincode-java/fabric-chaincode-shim/maven-metadata.xml'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.196.215] failed: connect timed out

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

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

1 actionable task: 1 executed
BUILD FAILED in 37s
"

我正在使用示例链代码 (fabirc-samples/chaincode/chaincode-example02/java)

最佳答案

我自己解决了这个问题。
解决方案是在实例化链代码之前构建具有代理设置的镜像,如下所示。

FROM hyperledger/fabric-javaenv

ENV JAVA_OPTS "-Dhttps.proxyPort=8080 -Dhttps.proxyHost=your.proxy.com - Dhttp.proxyPort=8080 -Dhttp.proxyHost=your.proxy.com"

关于java - 如何在代理后面构建java链码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57814611/

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