CreateProcess error=206, The filename or extension is too long (running the example cordapp using kotlin)


(Bhupendra Khatri) #1

Good day,

I’m having touble running the example cordapp using kotlin. There appears to be a problem with the filename or extension being too long, but I’m succesfully able to run using java.
I have also tried using different-2 Java JRE version (like - jre1.8.0_131, jre1.8.0_144)

[INFO ] 16:03:30,649 [driver-pool-thread-0] driver.DriverDSL.call - Starting out-of-process Node Controller
[INFO ] 16:03:30,654 [driver-pool-thread-1] driver.DriverDSL.call - Starting out-of-process Node NodeA
[INFO ] 16:03:30,832 [driver-pool-thread-1] driver.DriverDSL.call - Starting out-of-process Node NodeB
[ERROR] 16:03:30,937 [main] driver.DriverDSL.genericDriver - Driver shutting down because of exception
java.io.IOException: Cannot run program “C:\Program Files\Java\jdk1.8.0_31\jre\bin\java” (in directory “D:\CordaWorkspace\cordapp-tutorial\build\20171010103324\NodeA”): CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) ~[?:1.8.0_31]
at net.corda.testing.driver.ProcessUtilities.startJavaProcessImpl(ProcessUtilities.kt:53) ~[corda-test-utils-0.14.0.jar:?]
at net.corda.testing.driver.ProcessUtilities.startCordaProcess(ProcessUtilities.kt:26) ~[corda-test-utils-0.14.0.jar:?]
at net.corda.testing.driver.DriverDSL$Companion$startOutOfProcessNode$processFuture$1.call(Driver.kt:816) ~[corda-test-utils-0.14.0.jar:?]
at net.corda.testing.driver.DriverDSL$Companion$startOutOfProcessNode$processFuture$1.call(Driver.kt:759) ~[corda-test-utils-0.14.0.jar:?]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) ~[guava-21.0.jar:?]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) ~[guava-21.0.jar:?]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) ~[guava-21.0.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_31]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_31]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_31]
at java.lang.Thread.run(Thread.java:745) ~[?:1.8.0_31]
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessImpl.create(Native Method) ~[?:1.8.0_31]
at java.lang.ProcessImpl.(ProcessImpl.java:386) ~[?:1.8.0_31]
at java.lang.ProcessImpl.start(ProcessImpl.java:137) ~[?:1.8.0_31]
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ~[?:1.8.0_31]
… 14 more
[INFO ] 16:03:30,984 [driver-pool-thread-0] driver.DriverDSL.call - Starting out-of-process Node NodeC
[WARN ] 16:03:31,069 [main] driver.DriverDSL.shutdown - Exception while getting shutdown method, disregarding
java.io.IOException: Cannot run program “C:\Program Files\Java\jdk1.8.0_31\jre\bin\java” (in directory “D:\CordaWorkspace\cordapp-tutorial\build\20171010103324\NodeC”): CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) ~[?:1.8.0_31]
at net.corda.testing.driver.ProcessUtilities.startJavaProcessImpl(ProcessUtilities.kt:53) ~[corda-test-utils-0.14.0.jar:?]
at net.corda.testing.driver.ProcessUtilities.startCordaProcess(ProcessUtilities.kt:26) ~[corda-test-utils-0.14.0.jar:?]
at net.corda.testing.driver.DriverDSL$Companion$startOutOfProcessNode$processFuture$1.call(Driver.kt:816) ~[corda-test-utils-0.14.0.jar:?]
at net.corda.testing.driver.DriverDSL$Companion$startOutOfProcessNode$processFuture$1.call(Driver.kt:759) ~[corda-test-utils-0.14.0.jar:?]
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) ~[guava-21.0.jar:?]
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) ~[guava-21.0.jar:?]
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) ~[guava-21.0.jar:?]

Any help appreciated,
Bhupendra


(Roger Willis) #2

Are you on Windows? Try putting java in c:/Java.


(Bhupendra Khatri) #3

Yes Roger I am running the app on windows, I tried by putting java in c:/Java folder but not worked.
Can you provide another solution ?


(Roger Willis) #4

I don’t use windows, so can’t comment any further. @Clintonio?


(Bhupendra Khatri) #5

Got one solution for this issue, below are the steps:

  1. Clone the project: git clone https://github.com/corda/cordapp-example

  2. Open the project location in command prompt –

  • For eg: D:\KotlinWorkspace\cordapp-exampe
  • Run the command – gradlew deploynodes
  • You will get the message - Build Successful
  1. Put the JDK folder in root folder of ‘C’ drive –
  • For eg: C:\Java\jdk1.8.0_131
  1. Open project in IntelliJ –
  • Import gradle project
  • Go to project structure –
    o Check SDK – It should point - C:\Java\jdk1.8.0_131
    o Go to Modules tab – Remove java source (If you are getting issue - java and kotlin source can not point same directory)
  1. Run Example CorDapp - Kotlin