Doh!

I just read your discussion w/ Anton on his blog. Seems you've already
looked at the context classloader.

*shrug*. I'm stumped.

/mike.



On Mon, Dec 29, 2008 at 12:46 PM, Michael Reid <[email protected]> wrote:
> Hi,
>
> I'm not sure how to integrate this into the Tomcat JSP scenario, but I
> think the issue is that *use-context-classloader* is not set to true
> (it defaults to nil).
>
> Again, I'm not positive how to get your JSP to do this, but an
> untested stab at it would be just to wrap the call to
> clojure.main/with-bindings in a binding expression:
>
> Modified from http://paste.lisp.org/display/71541:
>
> final String startSwankScript =
>            "(add-classpath
> \"file:///c:/usr/unpacked/clojure/swank-clojure/\")\n" +
>            "(require (quote swank) (quote clojure.main))\n" +
>            "(binding [*use-context-classloader* true]\n" +
>            "  (clojure.main/with-bindings\n" +
>            "    (swank/ignore-protocol-version \"2008-11-23\")\n" +
>            "    (swank/start-server \"nul\" :encoding \"utf-8-unix\"
> :port 7777)))\n";
>
> I had a similar issue when working with Clojure in a J2EE web app
> context. This did the trick.
>
> Explanation:
>
> Clojure needs its own implementation of a ClassLoader in order to be
> able to define classes that it compiles from user code. By default,
> when it resolves classes it reuses this dynamic classloader.
>
> If you however bind the var *use-context-classloader*, then it will
> instead try and use Thread.currentThread().getContextClassLoader() to
> resolve classes. J2EE specifies that a servlet container must define a
> context class loader, and so with this set it should do what you need.
>
> /mike.
>
>
>
> On Sun, Dec 28, 2008 at 11:04 PM, Greg Harman <[email protected]> wrote:
>>
>> Thanks for that - I'm all up to date now. The bad news is that it
>> didn't seem to affect my problem at all.
>>
>> On Dec 28, 6:58 pm, "Michael Wood" <[email protected]> wrote:
>>
>>> The current version of Clojure is 1185.  Clojure was recently moved to
>>> Google Code:
>>>
>>> http://groups.google.com/group/clojure/browse_thread/thread/6b4a5284d...
>>>
>>> I don't know if that has anything to do with your problem, though.
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
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