Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Data readers are not loaded #11

Closed
kumarshantanu opened this issue Aug 10, 2013 · 10 comments
Closed

Data readers are not loaded #11

kumarshantanu opened this issue Aug 10, 2013 · 10 comments
Labels

Comments

@kumarshantanu
Copy link

The file data_readers.clj is not loaded with the JAR. For example, lein-try doesn't work with https://github.com/llasram/method-fn

@avescodes
Copy link
Owner

That's strange. Do you have an exact lein-try invocation and REPL commands to reproduce?

@kumarshantanu
Copy link
Author

This is how it failed with lein-try:

~$ lein try [org.platypope/method-fn "0.1.0"]
nREPL server started on port 57696
REPL-y 0.1.10
Clojure 1.5.1
    Exit: Control+D or (exit) or (quit)
Commands: (user/help)
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
          (user/sourcery function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Examples from clojuredocs.org: [clojuredocs or cdoc]
          (user/clojuredocs name-here)
          (user/clojuredocs "ns-here" "name-here")
user=> (require '[method.fn])
nil
user=> (map #mf/i toUpperCase ["foo" "bar"])
RuntimeException No reader function for tag mf/i  clojure.lang.LispReader$CtorReader.readTagged (LispReader.java:1190)
["foo" "bar"]RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:219)

user=>

Below is how it worked when I created a new project foo:

~/tmp/foo$ lein repl
nREPL server started on port 38157
REPL-y 0.1.10
Clojure 1.5.1
    Exit: Control+D or (exit) or (quit)
Commands: (user/help)
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
          (user/sourcery function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Examples from clojuredocs.org: [clojuredocs or cdoc]
          (user/clojuredocs name-here)
          (user/clojuredocs "ns-here" "name-here")
user=> (map #mf/i toUpperCase ["foo" "bar"])
IllegalStateException Attempting to call unbound fn: #'method.fn/instance  clojure.lang.Var$Unbound.throwArity (Var.java:43)
["foo" "bar"]RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException (Util.java:219)

user=> (require '[method.fn])
nil
user=> (map #mf/i toUpperCase ["foo" "bar"])
("FOO" "BAR")
user=>

xsc pushed a commit that referenced this issue Aug 11, 2013
@xsc
Copy link
Collaborator

xsc commented Aug 11, 2013

@rkneufeld
The above commit fixes the issue for me (Leiningen 2.2.0). Can you (or @kumarshantanu) verify that?
I assume that there's still some work to be done for 2.1.3 but I'm too tired to think about that now.

@avescodes
Copy link
Owner

I hit the following error running lein try [org.platypope/method-fn "0.1.0"]
off of that commit. Not sure what is up.

Error loading clojure.tools.nrepl.server: clojure.lang.RT.keyword(Ljava/lang/String;Ljava/lang/String;)Lclojure/lang/Keyword;
Error loading complete.core: clojure.lang.RT.keyword(Ljava/lang/String;Ljava/lang/String;)Lclojure/lang/Keyword;
Exception in thread "main" java.lang.ClassNotFoundException: clojure.tools.nrepl.server (NO_SOURCE_FILE:1)
  at clojure.lang.Compiler.analyzeSeq(Compiler.java:5376)
  at clojure.lang.Compiler.analyze(Compiler.java:5190)
  at clojure.lang.Compiler.access$100(Compiler.java:35)
  at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:4921)
  at clojure.lang.Compiler.analyzeSeq(Compiler.java:5369)
  at clojure.lang.Compiler.analyze(Compiler.java:5190)
  at clojure.lang.Compiler.analyze(Compiler.java:5151)
  at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:4670)
  at clojure.lang.Compiler$FnMethod.parse(Compiler.java:4328)
  at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3173)
  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.eval(Compiler.java:5415)
  at clojure.lang.Compiler.eval(Compiler.java:5391)
  at clojure.core$eval.invoke(core.clj:2382)
  at clojure.main$eval_opt.invoke(main.clj:235)
  at clojure.main$initialize.invoke(main.clj:254)
  at clojure.main$null_opt.invoke(main.clj:279)
  at clojure.main$main.doInvoke(main.clj:354)
  at clojure.lang.RestFn.invoke(RestFn.java:422)
  at clojure.lang.Var.invoke(Var.java:369)
  at clojure.lang.AFn.applyToHelper(AFn.java:165)
  at clojure.lang.Var.applyTo(Var.java:482)
  at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: clojure.tools.nrepl.server
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:58)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:270)
  at clojure.lang.RT.classForName(RT.java:1566)
  at clojure.lang.Compiler$HostExpr.maybeClass(Compiler.java:851)
  at clojure.lang.Compiler$HostExpr.access$300(Compiler.java:653)
  at clojure.lang.Compiler.macroexpand1(Compiler.java:5311)
  at clojure.lang.Compiler.analyzeSeq(Compiler.java:5355)
... 24 more
Exception in thread "Thread-4" clojure.lang.ExceptionInfo: Subprocess failed {:exit-code 1}
  at clojure.core$ex_info.invoke(core.clj:4327)
  at leiningen.core.eval$fn__2608.invoke(eval.clj:223)
  at clojure.lang.MultiFn.invoke(MultiFn.java:231)
  at leiningen.core.eval$eval_in_project.invoke(eval.clj:294)
  at clojure.lang.AFn.applyToHelper(AFn.java:167)
  at clojure.lang.AFn.applyTo(AFn.java:151)
  at clojure.core$apply.invoke(core.clj:619)
  at leiningen.repl$server$fn__6443.invoke(repl.clj:168)
  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:724)

@xsc
Copy link
Collaborator

xsc commented Aug 13, 2013

I think we need someone with a little more experience with Leiningen's classloader internals to solve this one... I'll keep on trying but I don't have a lot of time before Saturday. (And even if I can get it to work on my machine that doesn't guarantee anything, apparently...)

@avescodes
Copy link
Owner

Indeed, I reached out to other folks at @relevance for help

@xsc
Copy link
Collaborator

xsc commented Aug 15, 2013

@rkneufeld
I just saw the metadata :higher-order attached to some of Leiningen's built-in tasks (e.g. here) and how other tasks are subsequently called (i.e. like this). This might be a good candidate for solving this issue (and maybe prevent some future ones).

I'll have a look at it this weekend - unless someone else can address it more quickly.

@avescodes
Copy link
Owner

Seems like it may be fruitful. In the places it is used it seems to be a follow-on for some other explicit task (like lein with-profile X repl). The only difference for us is that our task is implicit. Let me know how it goes.

@avescodes
Copy link
Owner

Hey @kumarshantanu, were you trying to use method-fn inside or outside of an existing project? @xsc fixed in-project data readers in #12, but it seems like out-of-project data readers are still broken. I made #13 as follow-up for that portion.

@kumarshantanu
Copy link
Author

@rkneufeld I was trying it outside of any project. #13 makes sense.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants