librelist archives

« back to archive

lein repl failing outside of a project directory

lein repl failing outside of a project directory

From:
Lee Spector
Date:
2014-08-24 @ 13:14
In the past, "lein repl" executed in a directory without a project.clj 
just started up a generic repl.

Now, however, I'm getting an error when I try to do this. I assume that it
should still work and that this is a bug.

I just confirmed that it worked on a machine running Leiningen 2.2.0. Then
I did "lein upgrade", which brought me up to Leiningen 2.4.3, and it 
failed.

Below is the interaction in which I: 1) ran it successfully in 2.2.0, 2) 
called "lein version" to show the version, 3) did the upgrade, 4) tried to
do it again and failed, showing the backtrace.

This was all done in a new, empty directory, on a Mac running OS 10.8.5, 
but I also saw it on a Mac running 10.9.4.

 -Lee


robust:foo leespector$ lein repl
nREPL server started on port 52867
REPL-y 0.2.0
Clojure 1.5.1
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)

user=> (quit)
Bye for now!robust:foo leespector$ lein version
Leiningen 2.2.0 on Java 1.6.0_65 Java HotSpot(TM) 64-Bit Server VM
robust:foo leespector$ lein upgrade
The script at /Users/leespector/bin/lein will be upgraded to the latest 
stable version.
Do you want to continue [Y/n]? y

Upgrading...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   137    0   137    0     0    393      0 --:--:-- --:--:-- --:--:--   433
100 11895  100 11895    0     0  19866      0 --:--:-- --:--:-- --:--:--  446k

Manual self-install is deprecated; it will run automatically when necessary.
Downloading Leiningen to 
/Users/leespector/.lein/self-installs/leiningen-2.4.3-standalone.jar 
now...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   355    0   355    0     0   3725      0 --:--:-- --:--:-- --:--:--  4551
100 14.2M  100 14.2M    0     0  2215k      0  0:00:06  0:00:06 --:--:-- 2980k

Now running Leiningen 2.4.3 on Java 1.6.0_65 Java HotSpot(TM) 64-Bit Server VM
robust:foo leespector$ lein repl
nREPL server started on port 52884 on host 127.0.0.1 - nrepl://127.0.0.1:52884
Exception in thread "nREPL-worker-0" java.lang.NoSuchMethodError: 
clojure.tools.nrepl.StdOutBuffer.length()I
	at 
clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
	at clojure.lang.RestFn.invoke(RestFn.java:460)
	at 
clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown
Source)
	at java.io.PrintWriter.write(PrintWriter.java:412)
	at java.io.PrintWriter.write(PrintWriter.java:429)
	at clojure.core$fn__5471.invoke(core_print.clj:191)
	at clojure.lang.MultiFn.invoke(MultiFn.java:231)
	at clojure.core$pr_on.invoke(core.clj:3392)
	at clojure.core$pr.invoke(core.clj:3404)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.core$apply.invoke(core.clj:624)
	at clojure.core$prn.doInvoke(core.clj:3437)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invoke(core.clj:624)
	at clojure.core$println.doInvoke(core.clj:3457)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.main$repl_caught.invoke(main.clj:158)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
	at clojure.main$repl$fn__6634.invoke(main.clj:259)
	at clojure.main$repl.doInvoke(main.clj:257)
	at clojure.lang.RestFn.invoke(RestFn.java:1096)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.AFn.applyTo(AFn.java:144)REPL-y 0.3.2, nREPL 0.2.0-beta5
	at clojure.core$apply.invoke(core.clj:624)
	at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:171)
	at clojure.core$comp$fn__4192.invoke(core.clj:2402)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:138)
	at clojure.lang.AFn.run(AFn.java:22)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:695)
NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I  
clojure.tools.nrepl.middleware.session/session-out/fn--7630 
(session.clj:43)NoSuchMethodError 
clojure.tools.nrepl.StdOutBuffer.length()I  
clojure.tools.nrepl.middleware.session/session-out/fn--7630 
(session.clj:43)#<Namespace user>
Exception in thread "nREPL-worker-1" java.lang.NoSuchMethodError: 
clojure.tools.nrepl.StdOutBuffer.length()I
	at 
clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
	at clojure.lang.RestFn.invoke(RestFn.java:460)
	at 
clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown
Source)
	at java.io.PrintWriter.write(PrintWriter.java:412)
	at java.io.PrintWriter.write(PrintWriter.java:429)
	at clojure.core$fn__5471.invoke(core_print.clj:191)
	at clojure.lang.MultiFn.invoke(MultiFn.java:231)
	at clojure.core$pr_on.invoke(core.clj:3392)
	at clojure.core$pr.invoke(core.clj:3404)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.core$apply.invoke(core.clj:624)
	at clojure.core$prn.doInvoke(core.clj:3437)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invoke(core.clj:624)
	at clojure.core$println.doInvoke(core.clj:3457)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.main$repl_caught.invoke(main.clj:158)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
	at clojure.main$repl$fn__6634.invoke(main.clj:259)
	at clojure.main$repl.doInvoke(main.clj:257)
	at clojure.lang.RestFn.invoke(RestFn.java:1096)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invoke(core.clj:624)
	at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:171)
	at clojure.core$comp$fn__4192.invoke(core.clj:2402)
	at 
clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:138)

Error loading namespace; falling back to user	at clojure.lang.AFn.run(AFn.java:22)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:695)
NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I  
clojure.tools.nrepl.middleware.session/session-out/fn--7630 
(session.clj:43)NoSuchMethodError 
clojure.tools.nrepl.StdOutBuffer.length()I  
clojure.tools.nrepl.middleware.session/session-out/fn--7630 
(session.clj:43)user=> 

Re: [leiningen] lein repl failing outside of a project directory

From:
Colin Jones
Date:
2014-08-24 @ 17:49
This is fixed on master (tracked as
https://github.com/technomancy/leiningen/issues/1625) and a workaround
until a fix is released is to `lein upgrade 2.4.2`.

On Sun, Aug 24, 2014 at 8:14 AM, Lee Spector <lspector@hampshire.edu> wrote:
>
> In the past, "lein repl" executed in a directory without a project.clj 
just started up a generic repl.
>
> Now, however, I'm getting an error when I try to do this. I assume that 
it should still work and that this is a bug.
>
> I just confirmed that it worked on a machine running Leiningen 2.2.0. 
Then I did "lein upgrade", which brought me up to Leiningen 2.4.3, and it 
failed.
>
> Below is the interaction in which I: 1) ran it successfully in 2.2.0, 2)
called "lein version" to show the version, 3) did the upgrade, 4) tried to
do it again and failed, showing the backtrace.
>
> This was all done in a new, empty directory, on a Mac running OS 10.8.5,
but I also saw it on a Mac running 10.9.4.
>
>  -Lee
>
>
> robust:foo leespector$ lein repl
> nREPL server started on port 52867
> REPL-y 0.2.0
> Clojure 1.5.1
>     Docs: (doc function-name-here)
>           (find-doc "part-of-name-here")
>   Source: (source function-name-here)
>  Javadoc: (javadoc java-object-or-class-here)
>     Exit: Control+D or (exit) or (quit)
>
> user=> (quit)
> Bye for now!robust:foo leespector$ lein version
> Leiningen 2.2.0 on Java 1.6.0_65 Java HotSpot(TM) 64-Bit Server VM
> robust:foo leespector$ lein upgrade
> The script at /Users/leespector/bin/lein will be upgraded to the latest 
stable version.
> Do you want to continue [Y/n]? y
>
> Upgrading...
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100   137    0   137    0     0    393      0 --:--:-- --:--:-- --:--:--   433
> 100 11895  100 11895    0     0  19866      0 --:--:-- --:--:-- --:--:--  446k
>
> Manual self-install is deprecated; it will run automatically when necessary.
> Downloading Leiningen to 
/Users/leespector/.lein/self-installs/leiningen-2.4.3-standalone.jar 
now...
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100   355    0   355    0     0   3725      0 --:--:-- --:--:-- --:--:--  4551
> 100 14.2M  100 14.2M    0     0  2215k      0  0:00:06  0:00:06 --:--:-- 2980k
>
> Now running Leiningen 2.4.3 on Java 1.6.0_65 Java HotSpot(TM) 64-Bit Server VM
> robust:foo leespector$ lein repl
> nREPL server started on port 52884 on host 127.0.0.1 - nrepl://127.0.0.1:52884
> Exception in thread "nREPL-worker-0" java.lang.NoSuchMethodError: 
clojure.tools.nrepl.StdOutBuffer.length()I
>         at 
clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
>         at clojure.lang.RestFn.invoke(RestFn.java:460)
>         at 
clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown
Source)
>         at java.io.PrintWriter.write(PrintWriter.java:412)
>         at java.io.PrintWriter.write(PrintWriter.java:429)
>         at clojure.core$fn__5471.invoke(core_print.clj:191)
>         at clojure.lang.MultiFn.invoke(MultiFn.java:231)
>         at clojure.core$pr_on.invoke(core.clj:3392)
>         at clojure.core$pr.invoke(core.clj:3404)
>         at clojure.lang.AFn.applyToHelper(AFn.java:154)
>         at clojure.lang.RestFn.applyTo(RestFn.java:132)
>         at clojure.core$apply.invoke(core.clj:624)
>         at clojure.core$prn.doInvoke(core.clj:3437)
>         at clojure.lang.RestFn.applyTo(RestFn.java:137)
>         at clojure.core$apply.invoke(core.clj:624)
>         at clojure.core$println.doInvoke(core.clj:3457)
>         at clojure.lang.RestFn.invoke(RestFn.java:408)
>         at clojure.main$repl_caught.invoke(main.clj:158)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
>         at clojure.main$repl$fn__6634.invoke(main.clj:259)
>         at clojure.main$repl.doInvoke(main.clj:257)
>         at clojure.lang.RestFn.invoke(RestFn.java:1096)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
>         at clojure.lang.AFn.applyToHelper(AFn.java:152)
>         at clojure.lang.AFn.applyTo(AFn.java:144)REPL-y 0.3.2, nREPL 0.2.0-beta5
>         at clojure.core$apply.invoke(core.clj:624)
>         at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
>         at clojure.lang.RestFn.invoke(RestFn.java:425)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:171)
>         at clojure.core$comp$fn__4192.invoke(core.clj:2402)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:138)
>         at clojure.lang.AFn.run(AFn.java:22)
>         at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>         at java.lang.Thread.run(Thread.java:695)
> NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I  
clojure.tools.nrepl.middleware.session/session-out/fn--7630 
(session.clj:43)NoSuchMethodError 
clojure.tools.nrepl.StdOutBuffer.length()I  
clojure.tools.nrepl.middleware.session/session-out/fn--7630 
(session.clj:43)#<Namespace user>
> Exception in thread "nREPL-worker-1" java.lang.NoSuchMethodError: 
clojure.tools.nrepl.StdOutBuffer.length()I
>         at 
clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
>         at clojure.lang.RestFn.invoke(RestFn.java:460)
>         at 
clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown
Source)
>         at java.io.PrintWriter.write(PrintWriter.java:412)
>         at java.io.PrintWriter.write(PrintWriter.java:429)
>         at clojure.core$fn__5471.invoke(core_print.clj:191)
>         at clojure.lang.MultiFn.invoke(MultiFn.java:231)
>         at clojure.core$pr_on.invoke(core.clj:3392)
>         at clojure.core$pr.invoke(core.clj:3404)
>         at clojure.lang.AFn.applyToHelper(AFn.java:154)
>         at clojure.lang.RestFn.applyTo(RestFn.java:132)
>         at clojure.core$apply.invoke(core.clj:624)
>         at clojure.core$prn.doInvoke(core.clj:3437)
>         at clojure.lang.RestFn.applyTo(RestFn.java:137)
>         at clojure.core$apply.invoke(core.clj:624)
>         at clojure.core$println.doInvoke(core.clj:3457)
>         at clojure.lang.RestFn.invoke(RestFn.java:408)
>         at clojure.main$repl_caught.invoke(main.clj:158)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
>         at clojure.main$repl$fn__6634.invoke(main.clj:259)
>         at clojure.main$repl.doInvoke(main.clj:257)
>         at clojure.lang.RestFn.invoke(RestFn.java:1096)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
>         at clojure.lang.AFn.applyToHelper(AFn.java:152)
>         at clojure.lang.AFn.applyTo(AFn.java:144)
>         at clojure.core$apply.invoke(core.clj:624)
>         at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
>         at clojure.lang.RestFn.invoke(RestFn.java:425)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:171)
>         at clojure.core$comp$fn__4192.invoke(core.clj:2402)
>         at 
clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:138)
>
> Error loading namespace; falling back to user   at 
clojure.lang.AFn.run(AFn.java:22)
>         at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>         at java.lang.Thread.run(Thread.java:695)
> NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I  
clojure.tools.nrepl.middleware.session/session-out/fn--7630 
(session.clj:43)NoSuchMethodError 
clojure.tools.nrepl.StdOutBuffer.length()I  
clojure.tools.nrepl.middleware.session/session-out/fn--7630 
(session.clj:43)user=>



-- 
Colin Jones
@trptcolin

Re: [leiningen] lein repl failing outside of a project directory

From:
Lee Spector
Date:
2014-08-24 @ 17:56
Thanks!

 -Lee

On Aug 24, 2014, at 1:49 PM, Colin Jones <trptcolin@gmail.com> wrote:

> This is fixed on master (tracked as
> https://github.com/technomancy/leiningen/issues/1625) and a workaround
> until a fix is released is to `lein upgrade 2.4.2`.