Hi there,
Thanks for your post. I had the same problem and your solution is what I 
need.

To answer your question, USE_CONTEXT_CLASSLOADER still returns true in the 
following method (which is also in RT.java) because it is being bound to 
true when making a DynamicClassLoader:

static public ClassLoader makeClassLoader(){
return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction(){
public Object run(){
            try{
            Var.pushThreadBindings(RT.map(USE_CONTEXT_CLASSLOADER, RT.T));
// getRootClassLoader();
return new DynamicClassLoader(baseLoader());
            }
                finally{
            Var.popThreadBindings();
            }
}
});
}

So what I did was change the binding to RT.map(USE_CONTEXT_CLASSLOADER, 
RT.F), and that works.

On Saturday, June 30, 2012 3:03:02 PM UTC-7, Maris wrote:
>
>
> I am using clojure in apache karaf which has Thread context class loader 
> set to karaf jars.
>
> I changed use-context-classloader to false in RT.java:
>
> final static public Var USE_CONTEXT_CLASSLOADER =
> Var.intern(CLOJURE_NS, Symbol.intern("*use-context-classloader*"), 
> F).setDynamic();
>
> For some reason booleanCast(USE_CONTEXT_CLASSLOADER.deref()) doesn't 
> always return false  and RT still managed to create DynamicClassloader with 
> thread context classloader as parent.  Of course,   it wasn't able to 
> find any clojure classes.
>
> To make it work I commented out this line in baseLoader() method.
>
> else if (booleanCast(USE_CONTEXT_CLASSLOADER.deref())) {
>             return Thread.currentThread().getContextClassLoader();
> }
>
> Why booleanCast(USE_CONTEXT_CLASSLOADER.deref()) doesn't always return 
> false ? 
>
>

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