Herks
Herks

Reputation: 897

lein repl zip file is empty exception

I get the error messages when I enter lein repl in my project root folder. I have tried to delete the .lein directory in home folder and redownload lein but it doesn't work for me.

possible duplicate: ExceptionInInitializerError when using leiningen

Exception in thread "Thread-1" java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:214)
at java.util.zip.ZipFile.<init>(ZipFile.java:144)
at java.util.jar.JarFile.<init>(JarFile.java:153)
at java.util.jar.JarFile.<init>(JarFile.java:117)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at clojure.lang.Reflector.invokeConstructor(Reflector.java:180)
at leiningen.core.classpath$extract_native_deps.invoke(classpath.clj:43)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at leiningen.core.classpath$when_stale.doInvoke(classpath.clj:66)
at clojure.lang.RestFn.invoke(RestFn.java:580)
at leiningen.core.classpath$resolve_dependencies.doInvoke(classpath.clj:231)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at leiningen.core.eval$prep.invoke(eval.clj:54)
at leiningen.core.eval$eval_in_project.invoke(eval.clj:282)
at leiningen.repl$start_server.invoke(repl.clj:117)
at leiningen.repl$server$fn__6110.invoke(repl.clj:173)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1788)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:621)
at clojure.core$bound_fn_STAR_$fn__4102.doInvoke(core.clj:1810)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:722)

Edit: I'm running leiningen 2.1.2 on ubuntu 12.10 64bit machine.

Note: If I run lein repl outside my project root folder, it is fine.

Upvotes: 4

Views: 558

Answers (3)

Vlad A.
Vlad A.

Reputation: 179

this is because you can't name your uberjar the same as the jar file named internally by leiningen. just make sure you add something like "name-0.1.0-STABLE" or anything else like SNAPSHOT or LATEST to your :uberjar ... :uberjar-name.

Upvotes: 1

Chris Murphy
Chris Murphy

Reputation: 6509

Nothing would work for me (cleaning, blowing away ~/.m2). I even went to another machine. Then I thought maybe lein is confused with seeing these two entries together:

:jar-name "my-server.jar"
:uberjar-name "my-server.jar"

So I commented out :uberjar-name and ran lein jar and it didn't give me the exception - ran through to the end.

Upvotes: 0

Arthur Ulfeldt
Arthur Ulfeldt

Reputation: 91617

I have once successfully made that problem go away when using lein2 by running

lein clean

My next guess would be to move your ~/.m2/repository out of the way and try again.

Upvotes: 5

Related Questions