hyperledger-labs / weaver-dlt-interoperability

A platform, a protocol suite, and a set of tools, to enable interoperation for data sharing and asset movements between independent networks built on heterogeneous blockchain, or more generally, distributed ledger, technologies, in a manner that preserves the core blockchain tenets of decentralization and security.
Apache License 2.0
55 stars 45 forks source link

Build Corda Simple Application and Client failed with error `Unable to delete directory` #208

Closed cassc closed 2 years ago

cassc commented 2 years ago

I was following the tutorial and got the Unable to delete directory error when trying to build corda-simple-application

cd samples/corda/corda-simple-application
make build-local
cd ../fungible-house-token && rm -f github.properties && make build
make[1]: Entering directory '/home/garfield/hyperledger-labs/weaver-dlt-interoperability/samples/corda/fungible-house-token'
cp extension-flows/*.kt source/workflows/src/main/kotlin/net/corda/samples/tokenizedhouse/flows/
cp extension-states/*.kt source/contracts/src/main/kotlin/net/corda/samples/tokenizedhouse/states/
cp build.gradle source/build.gradle
cd source && ./gradlew clean jar
> Task :clean
> Task :clients:clean
> Task :contracts:clean
> Task :workflows:clean
> Task :contracts:compileKotlin
> Task :contracts:compileJava NO-SOURCE
> Task :contracts:processResources NO-SOURCE
> Task :contracts:classes UP-TO-DATE
> Task :contracts:configureCordappFatJar
> Task :contracts:inspectClassesForKotlinIC
> Task :contracts:jar

> Task :workflows:compileKotlin
w: /home/garfield/hyperledger-labs/weaver-dlt-interoperability/samples/corda/fungible-house-token/source/workflows/src/main/kotlin/net/corda/samples/tokenizedhouse/flows/IssueHouseTokenFlow.kt: (46, 13): Variable 'stx' is never used

> Task :workflows:compileJava NO-SOURCE
> Task :workflows:processResources
> Task :workflows:classes
> Task :workflows:configureCordappFatJar
> Task :workflows:inspectClassesForKotlinIC
> Task :workflows:jar
> Task :compileKotlin NO-SOURCE
> Task :compileJava NO-SOURCE
> Task :processResources
> Task :classes
> Task :configureCordappFatJar
> Task :inspectClassesForKotlinIC

> Task :jar
Cordapp metadata not defined for this gradle build file. See https://docs.corda.net/head/cordapp-build-systems.html#separation-of-cordapp-contracts-flows-and-services

> Task :clients:compileKotlin NO-SOURCE
> Task :clients:compileJava NO-SOURCE
> Task :clients:processResources NO-SOURCE
> Task :clients:classes UP-TO-DATE
> Task :clients:inspectClassesForKotlinIC
> Task :clients:jar

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 5s
19 actionable tasks: 19 executed
make[1]: Leaving directory '/home/garfield/hyperledger-labs/weaver-dlt-interoperability/samples/corda/fungible-house-token'
./gradlew clean installDist jar

> Configure project :contracts-kotlin
Warning: Publish won't work. Please use github.properties.template to create github.properties

> Configure project :workflows-kotlin
Warning: Publish won't work. Please use github.properties.template to create github.properties

> Task :clean UP-TO-DATE
> Task :clients:clean FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':clients:clean'.
> Unable to delete directory '/home/garfield/hyperledger-labs/weaver-dlt-interoperability/samples/corda/corda-simple-application/clients/build'
    Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
    - /home/garfield/hyperledger-labs/weaver-dlt-interoperability/samples/corda/corda-simple-application/clients/build/extracted-include-protos/main/google/protobuf
    - /home/garfield/hyperledger-labs/weaver-dlt-interoperability/samples/corda/corda-simple-application/clients/build/extracted-include-protos/main/google
    - /home/garfield/hyperledger-labs/weaver-dlt-interoperability/samples/corda/corda-simple-application/clients/build/extracted-include-protos/main
    - /home/garfield/hyperledger-labs/weaver-dlt-interoperability/samples/corda/corda-simple-application/clients/build/extracted-include-protos

* 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

BUILD FAILED in 1s
2 actionable tasks: 1 executed, 1 up-to-date
make: *** [makefile:11: build-local] Error 1
sandeepnRES commented 2 years ago

@cassc Can you re-try build, after forcefully deleting the samples/corda/corda-simple-application/clients/build directory, using sudo rm -rf? Some times such issue arise when gradle is unable clean i.e. delete the build directory (here it says it is being opened/used by some other process).

cassc commented 2 years ago

Thanks @sanvenDev! I find the problem might be caused by the incompatible JDK version. I downgraded to JDK 8 from 11, restarted from the beginning, now the compilation was success. Though there is still this warning, OpenJDK 64-Bit Server VM warning: Unable to open cgroup memory limit file /sys/fs/cgroup/memory/memory.limit_in_bytes (No such file or directory)

VRamakrishna commented 2 years ago

FYI, Corda only works with Java 8.

VRamakrishna commented 2 years ago

Please see the docs for prerequisites: https://labs.hyperledger.org/weaver-dlt-interoperability/docs/external/getting-started/test-network/setup-local#prerequisites (the same prerequisites are listed in other setup pages too.)

cassc commented 2 years ago

thanks, I think corda only works with oracle jdk 8.