cordapp-template-java icon indicating copy to clipboard operation
cordapp-template-java copied to clipboard

Error: Could not find or load main class net.corda.node.Corda

Open architect-tarun-narang opened this issue 2 years ago • 4 comments

Running the command on windows 10 - .\gradlew clean deployNodes throws an error - Error: Could not find or load main class net.corda.node.Corda
Logs are shared below, I tried to find any resolution on some blogs but all get in vain.

PS C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\Corda\templates\cordapp-template-java> .
\gradlew clean deployNodes

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

> Task :deployNodes  
Running Cordform task
Deleting C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\Corda\templates\cordapp-template-j
ava\build\nodes
Bootstrapping local test network in C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\Corda\t
emplates\cordapp-template-java\build\nodes
Generating node directory for Notary
Generating node directory for PartyA
Generating node directory for PartyB
Waiting for all nodes to generate their node-info files...

#### Error while generating node info file C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\
Corda\templates\cordapp-template-java\build\nodes\PartyA\logs ####
Error: Could not find or load main class net.corda.node.Corda
#### Error while generating node info file C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\
Corda\templates\cordapp-template-java\build\nodes\Notary\logs ####
Error: Could not find or load main class net.corda.node.Corda     
#### Error while generating node info file C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain\
Corda\templates\cordapp-template-java\build\nodes\PartyB\logs ####
Error: Could not find or load main class net.corda.node.Corda     

> Task :deployNodes FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':deployNodes'.
> Error while generating node info file. Please check the logs in C:\Users\48013\Desktop\Backup\Tarun\TSG\
Sample Apps\Blockchain\Corda\templates\cordapp-template-java\build\nodes\PartyA\logs.

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

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

BUILD FAILED in 24s
15 actionable tasks: 14 executed, 1 up-to-date

architect-tarun-narang avatar Feb 28 '22 10:02 architect-tarun-narang

Any suggestions on this would be appreciated. I further checked the logs to at this location but no luck. image

architect-tarun-narang avatar Mar 01 '22 06:03 architect-tarun-narang

Hi, I found same error. how do you fix it?

apiwitwutithumkitti avatar Mar 25 '22 09:03 apiwitwutithumkitti

Firstly, make sure you have Java8 Installed and secondly to make it work, I changed the source directory path from C:\Users\48013\Desktop\Backup\Tarun\TSG\Sample Apps\Blockchain
Corda\templates\cordapp-template-java\ TO C:\Users\48013\cordapp-template-java\

I kept the directory path small, sounds illogical but this did the trick for me.

architect-tarun-narang avatar Mar 25 '22 10:03 architect-tarun-narang

I try your trick, I change directory to shorter path. it work for me too Thank you.

apiwitwutithumkitti avatar Mar 25 '22 15:03 apiwitwutithumkitti