-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hangs on REPL Start: Error when starting java process due to length of classpath #1150
Comments
Thanks for the details, I'll take a look. In the meantime, if running on the command line with |
Ok - Thanks, I'll give that a go Edit: It's a maven project so not quite sure how I'd get the class path set up properly for a remote lein. |
Hi, Not sure if this is going to help with your investigations or not, but the issue only seems to be affecting projects which have a lot of maven plugin dependencies. In particular every project which has the rpm-maven-plugin as a dependency is having the issue. Commenting out these dependencies in the pom.xml allows me to start a REPL. Not sure if this is simply that I have reduced the length of the classpath or if there is something else at play, but thought it was worth mentioning. Either way, I have a short term solution, as I can obviously develop without the mvn rpm plugin dependency. Thanks, Matt. |
Ah, I see. Somq quick googling suggests that this is a generic problem, you're right that it seems that the generated classpath is too long: http://stackoverflow.com/a/10598074/155368. Since this doesn't seem to be Cursive specific, unfortunately my best advice at the moment is "don't do that", sadly. There does seem to be a filthy hack, see here. I'd need to investigate that to see if it was suitable for all REPL executions, though. |
Allegedly IntelliJ contains a different hack for this, see here |
I had seen those, It's just I have never seen it when making/building the project outside of Cursive. When doing a make directly through intellij there is no problem. I assumed it must be something to the way the plugin is forming the classpath. What is REPL make doing differently that the standard intellij make (ctrl f9 ) is not doing? Thanks, Matt. |
To be clearer, it's not actually the make task that causes the issue it's 'Calculating REPL classpath' This task may not be a cursive bit of code, but I don't see any other part of intellij calculating the classpath in the same way, so is cursive calling a particular function or something that has this issue? If that's the case let me know exactly what the call is and I can log an issue with whoever provides that. Thanks, Matt. |
One thing that Cursive does is to add source directories from dependent modules to the classpath, in case there's Clojure code there you might want to use. This mimics the way that lein depends on other projects. You could try disabling this under Settings->Languages & Frameworks->Clojure. BTW how is your REPL configured - are you using the nREPL in normal JVM process option? |
Hi, I've already tried disabling that setting, but I still had issues. When I'm running a main method from intellij, I'm now getting an message about the classpath being to long. Intellij then offers to enable file classpaths. So as stated above, Intellij has a way of dealing with this situation. Would it be possible for Cursive to hook into this functionality? I am using the nREPL in normal JVM process option. Thanks, Matt. |
Hi, Just to say, the only way I can "fix" this issue is ensure that class path file mode is enabled before trying to start any REPL instances. I usually achieve this by trying to run a java main method (I'm sure you can set this in a settings file as well) with the offending class path, Intellij then prompts you to enable class path file mode. If you do this then the issues go away. As correctly stated above, this is not a Cursive issue per se, however I think that if Cursive was able to hook into the 'enable file mode' logic when when REPLs are started it would be sufficient to resolve this issue once and for all. Thanks, Matt. |
Thanks Matt, that was helpful, searching for "classpath file mode" I've found where IntelliJ turns it on. I'll see if I can hook into that, it looks like I probably can. When I think I have a fix for this, I'll send you a dev build to test if that's ok, since it seems that you can reproduce the problem easily and I don't have access to a Windows machine. |
Having just looked at the code, I believe this issue should be obsolete these days. If this is not the case, please let me know the error that you're seeing and we can re-open this if required. |
I could really use some help with this. All my projects contain both clojure and clojurescript, and so they all hit this problem. I've been trying out a solution where i make a junction called
The hope being that Cursive would construct the classpath with a prefix of I'd really appreciate any insights anyone may have as to how the classpath gets put together when running in a normal JVM process so I can get my figwheel projects working with Cursive. |
I'm reopening this to take a look at it - @conan, are you still suffering from this? |
Hi,
I'm an experiencing an issue when starting REPL. It hangs at the make phase and then I have to restart intellij. Looking in the logs, that there was a problem running java due to the length of the classpath. This only seems to impact projects that have a lot of dependencies. For smaller projects I am not seeing the error due to the smaller amount of stuff on the classpath I'd imagine.
Any advice would be greatly appreciated. I'm currently unable to do development in Cursive due to this issue.
I'm running intellij 15.0 and the latest version of the cursive plug in (70)
Thanks,
Matt.
2015-11-10 18:35:21,067 [ 353596] INFO - figurations.GeneralCommandLine - Cannot run program "C:\Program Files\Java\jdk1.8.0_40\bin\java" (in directory "D:\derived-data\data-snapper"): CreateProcess error=206, The filename or extension is too long
java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_40\bin\java" (in directory "D:\derived-data\data-snapper"): CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:368)
at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:354)
at com.intellij.execution.process.OSProcessHandler.(OSProcessHandler.java:38)
at com.intellij.execution.process.DefaultJavaProcessHandler.(DefaultJavaProcessHandler.java:35)
at cursive.repl.process_runner$process_handler.invoke(process_runner.clj:81)
at cursive.repl.process_runner$start_nrepl_server$fn__12867.invoke(process_runner.clj:130)
at cursive.repl$create_new_repl$fn__11162.invoke(repl.clj:58)
at cursive.repl.nrepl$submit$fn__3757.invoke(nrepl.clj:122)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 13 more
2015-11-10 18:35:21,069 [ 353598] INFO - cursive.repl.nrepl - Shutting down REPL executor
2015-11-10 18:35:21,318 [ 353847] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /D:/IntelliJ IDEA 15.0/lib/jps-launcher.jar;C:/Program Files/Java/jdk1.8.0_40/lib/tools.jar;/D:/IntelliJ IDEA 15.0/lib/optimizedFileManager.jar;D:/IntelliJ IDEA 15.0/lib/ecj-4.4.jar
The text was updated successfully, but these errors were encountered: