Thanks Rich,

While I understand the desire to stick with java conventions when it
comes to adding to the classpath, it is too bad because it takes away
from the 'explorability' you get with a Repl.  I've gotten into the
habit of just dumping jars into my scratch folder and tooling away on
my running Repl to learn an API.  Oh well, I can tweak my workflow :)

-Scott

On Nov 17, 10:32 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Nov 17, 1:00 pm, Scott Fleckenstein <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi All,
>
> > I've run into a bug since upgrading past revision 1100, specifically
> > around adding to the classpath at runtime using add-classpath.  I've
> > attached a test case 
> > here:http://s3.amazonaws.com/nullstyle/precompile-bug.tar.gz
>
> > That file has three versions of clojure (r1100, r1101, r1106) and
> > web.clj, a sample app that loads jetty and starts a simple web
> > server.  You can use run.sh in that same tar to run each revision, one
> > after the other, to illustrate the breakage.
>
> > Basically, after adding a jar to the classpath, when importing a class
> > file from that jar I get a ClassNotFoundException thrown.  I don't
> > have enough java experience to know what would cause this problem.
> > Things work as expected on revision 1100.
>
> > Does anyone know what would cause this?  I'd be happy to put in the
> > time to help debug and fix this, but I'm at a loss for where next to
> > go.
>
> Such use of add-classpath is discouraged. The only reason for add-
> classpath is to let you pull in something if you've started up the
> repl without it. It shouldn't be a permanent part of any application
> design. In your case, you can get the local Jetty jars in the mix by
> supplying an extension dirs directive (-Djava.ext.dirs=) on the
> command line:
>
> java -Djava.ext.dirs=. -cp clojure-r1106.jar clojure.lang.Script
> web.clj
>
> All three revisions work with this change, and you can remove the add-
> classpath calls.
>
> The change that caused this is that now .class files for Clojure fn
> classes can be found and loaded by a classloader higher up in the
> chain, one which can't see the effects of add-classpath.
>
> I'm going to deprecate add-classpath because people consistently use
> it to avoid the standard classpath-setting mechanisms, at least until
> I can figure out a way to coordinate it with the standard classloader.
>
> Rich
--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to