On Sun, Apr 25, 2010 at 11:08 AM, gary ng <garyng2...@gmail.com> wrote:

> Hi,
>
> I am trying to use clojure to write servlets for GAE and is encountering
> problem with clojure.contrib.logging. When trying to use the logging
> function, I get the following exception:
>
> java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
>  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
>  at java.security.AccessController.doPrivileged(Native Method)
>  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>  at
> com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>  at clojure.contrib.logging$fn__49$fn__51.invoke(logging.clj:188)
>  at clojure.lang.AFn.applyToHelper(AFn.java:173)
>  at clojure.lang.AFn.applyTo(AFn.java:164)
>  at clojure.core$apply__4370.invoke(core.clj:436)
>  at clojure.core$memoize__6537$fn__6539.doInvoke(core.clj:4328)
>  at clojure.lang.RestFn.invoke(RestFn.java:413)
>  at guestbook.servlet$_doGet__3.invoke(servlet.clj:15)
>
>
>
Seems to find the reason. The GAE SDK does package org.apache.common.logging
which means when I am 'gen-class' my servlet, it saw this and thus the
logging is 'nailed' to use this class. But the runtime doesn't have it. I
can fallback to use java.util.logging but see this to be a more common
problem and don't know how to solve elegantly.

What seems to be happening is that when I build my 'gen-class' package, the
class is nailed down even though logging.clj itself is not gen-classed. Then
how can I achieve this form of 'dynamic loading and configuration' as I do
need gen-class for my servlet class and it is almost impossible to control
what jar is visible during the development/build environment.

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