Hi,

2011/4/14 Konrad Hinsen <konrad.hin...@fastmail.net>:
> On 13 Apr, 2011, at 17:16 , Aaron Cohen wrote:
>
>> Do you need to bind *use-context-classloader* to true?
>
> I considered this, not so much because I understand what this setting is good 
> for, but because its name suggests it might be relevant. But then I looked at 
> the source code to figure what what actually does, and my conclusion is: 
> nothing. The var *use-context-classloader* is created with the default 
> binding "true", and the only place where it is modified pushes a thread 
> binding to "true" as well. So as long as nothing outside Clojure itself binds 
> this to "false", it should always be "true".
>
> On the other hand, the function baseLoader() in RT.java does suggest that 
> this setting is of relevance. I just don't understand how it is support to 
> work.

I won't pretend I understand how all this works, especially wrt to
subtleties between loading from clojure, auto-loading of AOT compiled
gen-classes, etc., but what has worked great so far for clojure.osgi
and indirectly for CCW in a complex classloader hell context (OSGi)
was the following:

* set the context class loader via
Thread.currentThread().setContextClassLoader(loader)
* rebind Compiler.LOADER with loader

Note: I do not pretend this works in all situations, nor do I pretend
that one of the two above is redundant, nor that there could be a
simpler (cleaner !) solution.

But better check the source by yourself : (we're using clojure.osgi
version 1.2.10 for ccw, so check this tag to be certain we're talking
about the same thing) :

https://github.com/aav/clojure.osgi/blob/1.2.10/clojure.osgi/src/clojure/osgi/ClojureOSGi.java

Cheers,

-- 
Laurent

-- 
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

Reply via email to