swannodette / textmate-clojure

TextMate bundle for Clojure
91 stars 25 forks source link

Java exception attempting to 'Load File' #10

Closed scottgerring closed 13 years ago

scottgerring commented 13 years ago

On Mac OS 10.6.4, with the current textmate-clojure as of 10/11/2010. I am getting an exception when attempting to load a project file within textmate. After purging all clojure and cake related bits from my machine, I set up my environment as follows:

$ sudo gem install cake Successfully installed cake-0.5.5 1 gem installed Installing ri documentation for cake-0.5.5... Installing RDoc documentation for cake-0.5.5...

Then, I create my project:

$ cake new testProject [pom] creating pom.xml [deps] Fetching dependencies... [deps] Copying 2 files to /Users/Scott/.cake/build/lib [deps] Deleting directory /Users/Scott/.cake/lib [deps] Attempting to rename dir: /Users/Scott/.cake/build/lib to /Users/Scott/.cake/lib [clean] Deleting /Users/Scott/.cake/.cake/run/pom [deps] Restarting project jvm [new] Creating template directory: ~/.cake/templates/default [new] Created dir: /Users/Scott/.cake/templates/default [new] Created dir: /Users/Scott/.cake/templates/default/src/+project+ [new] Created template file: src/+project+/core.clj [new] Created dir: /Users/Scott/.cake/templates/default/test [new] Created template file: project.clj [new] Created template file: .gitignore [new] Created template LICENSE file (Eclipse Public License) [new] Creating a new project based on ~/.cake/templates/default [new] Copying 4 files to /Users/Scott/Documents/Projects/New Code/Clojure/testProject [new] Copied 4 empty directories to 1 empty directory under /Users/Scott/Documents/Projects/New Code/Clojure/testProject [new] Renaming directories with +project+ in their name [new] Replacing +project+ with 'testProject' in all files.

I edit the dependencies as described on the project page, and fetch the dependencies:

  [pom] creating pom.xml
 [deps] Fetching dependencies...
 [deps] Copying 2 files to /Users/Scott/Documents/Projects/New Code/Clojure/testProject/build/lib
 [deps] Deleting directory /Users/Scott/Documents/Projects/New Code/Clojure/testProject/lib
 [deps] Attempting to rename dir: /Users/Scott/Documents/Projects/New Code/Clojure/testProject/build/lib to /Users/Scott/Documents/Projects/New Code/Clojure/testProject/lib
[clean] Deleting /Users/Scott/Documents/Projects/New Code/Clojure/testProject/.cake/run/pom
 [deps] Restarting project jvm

When I open the project in textmate, and attempt to load the newly created "core.clj" file, under src/testProject, I get the following stacktrace in the output window:

java.lang.RuntimeException: java.lang.IllegalArgumentException: Unable to resolve classname: :dynamic at clojure.lang.Compiler.maybePrimitiveType(Compiler.java:1118) at clojure.lang.Compiler$MethodExpr.emitTypedArgs(Compiler.java:1142) at clojure.lang.Compiler$StaticMethodExpr.emit(Compiler.java:1423) at clojure.lang.Compiler$InvokeExpr.emitArgsAndCall(Compiler.java:3003) at clojure.lang.Compiler$InvokeExpr.emit(Compiler.java:2944) at clojure.lang.Compiler$IfExpr.doEmit(Compiler.java:2244) at clojure.lang.Compiler$IfExpr.emit(Compiler.java:2221) at clojure.lang.Compiler$BodyExpr.emit(Compiler.java:4714) at clojure.lang.Compiler$LetExpr.doEmit(Compiler.java:5007) at clojure.lang.Compiler$LetExpr.emit(Compiler.java:4962) at clojure.lang.Compiler$BodyExpr.emit(Compiler.java:4714) at clojure.lang.Compiler$ObjMethod.emit(Compiler.java:4465) at clojure.lang.Compiler$FnExpr.emitMethods(Compiler.java:3103) at clojure.lang.Compiler$ObjExpr.compile(Compiler.java:3687) at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3218) at clojure.lang.Compiler.analyzeSeq(Compiler.java:5367) at clojure.lang.Compiler.analyze(Compiler.java:5190) at clojure.lang.Compiler.eval(Compiler.java:5421) at clojure.lang.Compiler.load(Compiler.java:5857) at clojure.lang.Compiler.loadFile(Compiler.java:5820) at clojure.lang.RT$3.invoke(RT.java:296) at cake.server$run_file.invoke(server.clj:98) at cake.server$create$fn__631$fn__638.invoke(server.clj:138) at cake.server$create$fn__631.invoke(server.clj:120) at cake.utils.server_socket$accept_fn$fn__309$fn__312.invoke(server_socket.clj:39) at cake.utils.server_socket$accept_fn$fn__309.invoke(server_socket.clj:38) at clojure.lang.AFn.run(AFn.java:24) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.IllegalArgumentException: Unable to resolve classname: :dynamic at clojure.lang.Compiler$HostExpr.tagToClass(Compiler.java:916) at clojure.lang.Compiler$InvokeExpr.getJavaClass(Compiler.java:3030) at clojure.lang.Compiler$LocalBinding.hasJavaClass(Compiler.java:4545) at clojure.lang.Compiler$LocalBindingExpr.hasJavaClass(Compiler.java:4639) at clojure.lang.Compiler.maybePrimitiveType(Compiler.java:1109) ... 27 more clojure.lang.Compiler$CompilerException: java.lang.VerifyError: (class: textmate$eval2387, method: invoke signature: ()Ljava/lang/Object;) Unable to pop operand off an empty stack (load_file.clj:0) at clojure.lang.Compiler.eval (Compiler.java:5440) clojure.lang.Compiler.load (Compiler.java:5857) clojure.lang.Compiler.loadFile (Compiler.java:5820) clojure.lang.RT$3.invoke (RT.java:296) cake.server$run_file.invoke (server.clj:98) cake.server$create$fn__631$fn__638.invoke (server.clj:138) cake.server$create$fn__631.invoke (server.clj:120) cake.utils.server_socket$accept_fn$fn__309$fn__312.invoke (server_socket.clj:39) cake.utils.server_socket$accept_fn$fn__309.invoke (server_socket.clj:38) clojure.lang.AFn.run (AFn.java:24) java.lang.Thread.run (Thread.java:680) Caused by: java.lang.VerifyError: (class: textmate$eval2387, method: invoke signature: ()Ljava/lang/Object;) Unable to pop operand off an empty stack at java.lang.Class.getDeclaredConstructors0 (Class.java:-2) java.lang.Class.privateGetDeclaredConstructors (Class.java:2389) java.lang.Class.getConstructor0 (Class.java:2699) java.lang.Class.newInstance0 (Class.java:326) java.lang.Class.newInstance (Class.java:308) clojure.lang.Compiler$ObjExpr.eval (Compiler.java:3977) clojure.lang.Compiler.eval (Compiler.java:5423) clojure.lang.Compiler.load (Compiler.java:5857) clojure.lang.Compiler.loadFile (Compiler.java:5820) clojure.lang.RT$3.invoke (RT.java:296) cake.server$run_file.invoke (server.clj:98) cake.server$create$fn__631$fn__638.invoke (server.clj:138) cake.server$create$fn__631.invoke (server.clj:120) cake.utils.server_socket$accept_fn$fn__309$fn__312.invoke (server_socket.clj:39) cake.utils.server_socket$accept_fn$fn__309.invoke (server_socket.clj:38) clojure.lang.AFn.run (AFn.java:24) java.lang.Thread.run (Thread.java:680)

Also, if I try to "eval" a function definition, I get:

Unable to resolve symbol: defn in this context
clojure.lang.Compiler.resolveIn(Compiler.java:5677)
clojure.lang.Compiler.resolve(Compiler.java:5621)
clojure.lang.Compiler.analyzeSymbol(Compiler.java:5584)
clojure.lang.Compiler.analyze(Compiler.java:5172)
clojure.lang.Compiler.analyze(Compiler.java:5151)
clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3036)
clojure.lang.Compiler.analyzeSeq(Compiler.java:5371)
clojure.lang.Compiler.analyze(Compiler.java:5190)
clojure.lang.Compiler.analyze(Compiler.java:5151)
clojure.lang.Compiler.eval(Compiler.java:5428)
clojure.lang.Compiler.eval(Compiler.java:5391)
clojure.core$eval.invoke(core.clj:2382)
textmate$display_form_eval$fn__2764.invoke(utils.clj:258)
textmate$display_form_eval.invoke(utils.clj:257)
textmate$eval2776.invoke(eval_last_sexpr.clj:5)
clojure.lang.Compiler.eval(Compiler.java:5424)
clojure.lang.Compiler.load(Compiler.java:5857)
clojure.lang.Compiler.loadFile(Compiler.java:5820)
clojure.lang.RT$3.invoke(RT.java:296)
cake.server$run_file.invoke(server.clj:98)
cake.server$create$fn__631$fn__638.invoke(server.clj:138)
cake.server$create$fn__631.invoke(server.clj:120)
cake.utils.server_socket$accept_fn$fn__309$fn__312.invoke(server_socket.clj:39)
cake.utils.server_socket$accept_fn$fn__309.invoke(server_socket.clj:38)
clojure.lang.AFn.run(AFn.java:24)
java.lang.Thread.run(Thread.java:680)

I'm fairly certain that the problem began after a "gem update", which appears to have bumped cake up a version (as evidenced by a newer folder layout than older projects i've created). In addition, trying to load files in any of the older projects now generates the same error.

I can use "cake repl" and "cake run" from the terminal fine, and invoke my projects' code directly.

Until this problem arose, I was enjoying using the textmate bundle, it has really simplified my workflow!

swannodette commented 13 years ago

Looking into this.

swannodette commented 13 years ago

K looks like a cake issue that's been patched. Should be fixed when they roll out 0.5.6 which should be any moment now.

scottgerring commented 13 years ago

Fixed for me in the new cake release, thanks!