I have a use case where a daemon needs to read full namespaces from an
external jar.
I can successfuly access the namespace in the jar with tools.namespace/
find-namespaces-in-jarfile, then from the jarfile, selecting
appropriate entries, coercing into readers and then loading with load-
reader.
This approach breaks as soon as the supplied jar does requires, since
the jar is not on the classpath. I am a bit surprised that setting a
classloader in the current thread with setContextClassLoader does not
work, as my binding for *use-context-classloader* is the default:
true.
I could obviously supply a fixed directory that is always in the
classpath but that would require having two configuration files, which
I thought I could avoid.
Is there a way around this, or am I stuck ?
HTH
On Wed, Dec 7, 2011 at 8:12 PM, vitalyper <vita...@yahoo.com> wrote:
> You can add jar to a classpath at runtime via the hack below.
>
> HTH
>
> On Dec 7, 10:26 am, Pierre-Yves Ritschard <p...@spootnik.org> wrote:
>> Hi,
>>
>> I have a use case where a daemon needs to read full namespaces from an
>> external jar.
>> I can successfuly access the namespace in the jar with tools.namespace/
>> find-namespaces-in-jarfile, then from the jarfile, selecting
>> appropriate entries, coercing into readers and then loading with load-
>> reader.
>>
>> This approach breaks as soon as the supplied jar does requires, since
>> the jar is not on the classpath. I am a bit surprised that setting a
>> classloader in the current thread with setContextClassLoader does not
>> work, as my binding for *use-context-classloader* is the default:
>> true.
>>
>> I could obviously supply a fixed directory that is always in the
>> classpath but that would require having two configuration files, which
>> I thought I could avoid.
>>
>> Is there a way around this, or am I stuck ?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@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+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
https://github.com/hiredman/clojurebot/blob/master/src/clojurebot/plugin.clj
--
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?