Re: Hyperledger install Java chaincode #fabric-chaincode

Matthew White

This, I believe, will be a mismatch of versions on the `build.gradle` file;  
Check the version of the 'shadowJar' plugin used - in some examples there was an older version of this that was for previous gradle versions... Latest version details are here >
Regards, Matthew.
Matthew B White  IBM Blockchain Solutions Architect
Email me at WHITEMAT@...
Find me on StackOverflow, and generally at
Note: restricted availability for meetings 14:30 to 17:00 UK Tuesday 
IBM United Kingdom Limited, Hursley Park, Winchester, Hampshire, SO21 2JN

"The wrong answers are the ones you go looking for when the right answers stare you in the face"
----- Original message -----
From: "Antoni Massó Mola" <antonimassomola@...>
Sent by: fabric@...
To: fabric@...
Subject: [EXTERNAL] [Hyperledger Fabric] Hyperledger install Java chaincode #fabric-chaincode
Date: Thu, Mar 12, 2020 7:50 AM

I'm trying to install Java chaincode. I'm able to install go & javascript chaincode but Java installation:

peer chaincode install -n chaincode_exampleJava1 -v 1.2 -l java -p /opt/gopath/src/

Fails with the following error (tried with v1.4 & v2):

Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 "+ INPUT_DIR=/chaincode/input
+ OUTPUT_DIR=/chaincode/output
++ find /chaincode/input -name .jar
++ paste -s -d : -
++ find /chaincode/input -name '*.jar'
++ wc -l
+ for DIR in ${INPUT_DIR} ${INPUT_DIR}/src
+ '[' -f /chaincode/input/build.gradle -o -f /chaincode/input/build.gradle.kts ']'
+ '[' -f /chaincode/input/pom.xml ']'
+ for DIR in ${INPUT_DIR} ${INPUT_DIR}/src
+ '[' -f /chaincode/input/src/build.gradle -o -f /chaincode/input/src/build.gradle.kts ']'
+ buildGradle /chaincode/input/src /chaincode/output
+ cd /chaincode/input/src
Gradle build
+ echo 'Gradle build'
+ '[' -f ./gradlew ']'
+ gradle build shadowJar

Welcome to Gradle 5.6.2!

Here are the highlights of this release:
 - Incremental Groovy compilation
 - Groovy compile avoidance
 - Test fixtures for Java projects
 - Manage plugin versions via settings script

For more details see

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Receiver class com.github.jengelman.gradle.plugins.shadow.internal.DependencyFileCollection does not define or inherit an implementation of the resolved method 'abstract org.gradle.api.tasks.TaskDependency getBuildDependencies()' of interface org.gradle.api.Buildable.

* 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

Any help would be appreciated. Thanks.
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Join to automatically receive all group messages.