0

Does anyone know how to build java chaincode behind proxy? On instantiating a java chaincode behind proxy I'm getting the following error.

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
"

I'm using sample chaincode (fabirc-samples/chaincode/chaincode-example02/java)

gunso
  • 1

1 Answers1

0

I solved the problem by myself.
The solution is building image that has proxy setting like below one before instantiating chaincode.

FROM hyperledger/fabric-javaenv

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