Re: How to troubleshoot FileNotFoundException: Could not locate clojure/tools/namespace/parse...?
Thank you all! @Stuart Great to know that 0.2.1 is backwards compatible. @Sean You are right about running it separately. But I am lazy and it is easier to be able to just run (sdoc) from repl and get the ns browser up. On the other hand, it is perhaps not so smart to pollute one's profile with all possible tools and then spend hours debugging conflicts :) 2014-04-03 23:34 GMT+02:00 Stuart Sierra : > > > On Wednesday, April 2, 2014 7:49:07 AM UTC-4, Jakub Holy wrote: >> >> When starting lein (namely lein ring server) I got a little helpful >> exception and stack trace with the key line being: >> >> FileNotFoundException: Could not locate >> clojure/tools/namespace/parse__init.class >> or clojure/tools/namespace/parse.clj on classpath >> > > > This could be caused by different libraries or plugins depending on > different versions of tools.namespace. > > clojure.tools.namespace.parse is present starting with tools.namespace > version 0.2.0. > > Note: In tools.namespace version 0.2.0 I removed the namespace > `clojure.tools.namespace` which was present in 0.1.x. After learning that > this caused problems, I added the deprecated namespace back in version > 0.2.1. > > You can use `lein deps :tree` to figure out which version is getting > included in your project. > > You can add an explicit dependency in your project.clj on a version that > you know is compatible with all the libraries/plugins you want to use. > > In this case, the latest version of tools.namespace is backwards > compatible with 0.1.X versions. If that were not the case, you'd be out of > luck. > > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/h3U0zx9kEvo/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- *Forget software. Strive to make an impact, deliver a valuable change.* * (**Vær så snill og hjelp meg med å forbedre norsken **min –** skriftlig og muntlig. Takk!**)* Jakub Holy Solutions Engineer | +47 966 23 666 Iterate AS | www.iterate.no The Lean Software Development Consultancy - http://theholyjava.wordpress.com/ - -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to troubleshoot FileNotFoundException: Could not locate clojure/tools/namespace/parse...?
On Wednesday, April 2, 2014 7:49:07 AM UTC-4, Jakub Holy wrote: > > When starting lein (namely lein ring server) I got a little helpful > exception and stack trace with the key line being: > > FileNotFoundException: Could not locate > clojure/tools/namespace/parse__init.class or > clojure/tools/namespace/parse.clj on classpath > This could be caused by different libraries or plugins depending on different versions of tools.namespace. clojure.tools.namespace.parse is present starting with tools.namespace version 0.2.0. Note: In tools.namespace version 0.2.0 I removed the namespace `clojure.tools.namespace` which was present in 0.1.x. After learning that this caused problems, I added the deprecated namespace back in version 0.2.1. You can use `lein deps :tree` to figure out which version is getting included in your project. You can add an explicit dependency in your project.clj on a version that you know is compatible with all the libraries/plugins you want to use. In this case, the latest version of tools.namespace is backwards compatible with 0.1.X versions. If that were not the case, you'd be out of luck. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to troubleshoot FileNotFoundException: Could not locate clojure/tools/namespace/parse...?
On Apr 3, 2014, at 4:30 AM, Jakub Holy wrote: > The stack trace points to ns-tracker as the cause and indeed removing it > fixes the problem. However it is actually conflict between ns-tracker and > clj-ns-browser that causes the failure; removing any one fixes it. But the > stack trace points only to ns-tracker (I guess we actually cannot expect more > from it.) Thank you for reminding me of lein deps :tree, I should finally > remember to use it. It unfortunately does not mention clj-ns-browser at all > (I have it among user dependencies in profile.clj). Any idea why could that > be? I believe the answer is that clj-ns-browser is a tool that you run separately on your code, rather than something that runs as part of your code - so there's no execution path in your code that crosses into clj-ns-browser. However, Leiningen will merge in your :user dependencies from profiles.clj - which is why you get the conflict. You might solve this by putting clj-ns-browser in a separate profile, say, :browse and then explicitly using that profile when you want to fire up clj-ns-browser (via lein's with-profile feature). Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) signature.asc Description: Message signed with OpenPGP using GPGMail
Re: How to troubleshoot FileNotFoundException: Could not locate clojure/tools/namespace/parse...?
Hello Sean, Thank you for your asnwer! It was a nice and helpful demonstration of how to read stack traces better. The stack trace points to *ns-tracker* as the cause and indeed removing it fixes the problem. However it is actually conflict between ns-tracker and *clj-ns-browser* that causes the failure; removing any one fixes it. But the stack trace points only to ns-tracker (I guess we actually cannot expect more from it.) Thank you for reminding me of lein deps :tree, I should finally remember to use it. It unfortunately does not mention clj-ns-browser at all (I have it among user dependencies in profile.clj). Any idea why could that be? Thank you! 2014-04-03 0:01 GMT+02:00 Sean Corfield : > On Apr 2, 2014, at 4:49 AM, Jakub Holy wrote: > > *The problem is that the stack trace contains no indication that it is > clj-ns-browser that is causing the problem.* I would like to know if > there are any tricks to troubleshoot these problems other than binary > search through deps/plugins in profile.clj. > > > Well you can use: lein deps :tree > > That will show you any version conflicts as well as the paths by which > those conflicts are reached - and it will suggest exclusions to resolve the > conflicts (although some version conflicts can't be resolved as-is - you > must upgrade one or other of your dependencies to get things working). > > But if you want to start from the stack trace... > > A lot of the stack trace can be thrown away / ignored which helps narrow > things down... > > $ lein ring server > Exception in thread "main" java.io.FileNotFoundException: Could not locate > clojure/tools/namespace/parse__init.class or > clojure/tools/namespace/parse.clj on classpath: , > compiling:(ns_tracker/parse.clj:1:1) > > > ^^^ This tells us it failed to load clojure.tools.namespace.parse while > compiling ns-tracker.parse... > > at ns_tracker.core$eval514$loading__4958__auto515.invoke(core.clj:1) > at ns_tracker.core$eval514.invoke(core.clj:1) > > > ^^^ ...which it found in ns-tracker.core... > > at > ring.middleware.reload$eval508$loading__4958__auto509.invoke(reload.clj:1) > at ring.middleware.reload$eval508.invoke(reload.clj:1) > > > ^^^ ...which it found in ring.middleware.reload... > > at > ring.server.standalone$eval15$loading__4958__auto16.invoke(standalone.clj:1) > at ring.server.standalone$eval15.invoke(standalone.clj:1) > > > ^^^ ...which it found in ring.server.standalone... > > at > ring.server.leiningen$eval9$loading__4958__auto10.invoke(leiningen.clj:1) > at ring.server.leiningen$eval9.invoke(leiningen.clj:1) > > > ^^^ ...and now we're at the top-level (since this was invoked from the > user namespace): > > at user$eval5.invoke(form-init6357505187919130689.clj:1) > > > And because all these seem to be at line 1, they're likely the (ns ...) > forms and so we have part of the dependency chain. I mostly just skipped > over all the clojure.* stuff except for noting (in my head) that > clojure.core/load and clojure.core/use were called along that path. > > Does that help at all? > > Sean Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ > > "Perfection is the enemy of the good." > -- Gustave Flaubert, French realist novelist (1821-1880) > > > > -- *Forget software. Strive to make an impact, deliver a valuable change.* * (**Vær så snill og hjelp meg med å forbedre norsken **min –** skriftlig og muntlig. Takk!**)* Jakub Holy Solutions Engineer | +47 966 23 666 Iterate AS | www.iterate.no The Lean Software Development Consultancy - http://theholyjava.wordpress.com/ - -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to troubleshoot FileNotFoundException: Could not locate clojure/tools/namespace/parse...?
On Apr 2, 2014, at 4:49 AM, Jakub Holy wrote: > The problem is that the stack trace contains no indication that it is > clj-ns-browser that is causing the problem. I would like to know if there are > any tricks to troubleshoot these problems other than binary search through > deps/plugins in profile.clj. Well you can use: lein deps :tree That will show you any version conflicts as well as the paths by which those conflicts are reached - and it will suggest exclusions to resolve the conflicts (although some version conflicts can't be resolved as-is - you must upgrade one or other of your dependencies to get things working). But if you want to start from the stack trace... A lot of the stack trace can be thrown away / ignored which helps narrow things down... > $ lein ring server > Exception in thread "main" java.io.FileNotFoundException: Could not locate > clojure/tools/namespace/parse__init.class or > clojure/tools/namespace/parse.clj on classpath: , > compiling:(ns_tracker/parse.clj:1:1) ^^^ This tells us it failed to load clojure.tools.namespace.parse while compiling ns-tracker.parse... > at ns_tracker.core$eval514$loading__4958__auto515.invoke(core.clj:1) > at ns_tracker.core$eval514.invoke(core.clj:1) ^^^ ...which it found in ns-tracker.core... > at > ring.middleware.reload$eval508$loading__4958__auto509.invoke(reload.clj:1) > at ring.middleware.reload$eval508.invoke(reload.clj:1) ^^^ ...which it found in ring.middleware.reload... > at > ring.server.standalone$eval15$loading__4958__auto16.invoke(standalone.clj:1) > at ring.server.standalone$eval15.invoke(standalone.clj:1) ^^^ ...which it found in ring.server.standalone... > at > ring.server.leiningen$eval9$loading__4958__auto10.invoke(leiningen.clj:1) > at ring.server.leiningen$eval9.invoke(leiningen.clj:1) ^^^ ...and now we're at the top-level (since this was invoked from the user namespace): > at user$eval5.invoke(form-init6357505187919130689.clj:1) And because all these seem to be at line 1, they're likely the (ns ...) forms and so we have part of the dependency chain. I mostly just skipped over all the clojure.* stuff except for noting (in my head) that clojure.core/load and clojure.core/use were called along that path. Does that help at all? Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) signature.asc Description: Message signed with OpenPGP using GPGMail