Search code examples
loggingclojurelog4jnoclassdeffounderror

NoClassDefFoundError with clojure tools logging


I'm using clojure.tools.logging for a web application. For long times it works fine, with org.clojure/tools.logging "0.1.2". I start and stop then re-start clojure repl[lein repl] for multiple time for development testing purposes. Suddenly, repl throws following error. I update the logging library to org.clojure/tools.logging "0.2.3", but, no use. Still I get the same error, It only gave this error on the repl, but, with the application running, logs work fine. I coudn't identify where is the issue.

I'm using lo4j with clojure.tools.logging.

java.lang.NoClassDefFoundError: clojure/tools/logging/impl/LoggerFactory (NO_SOURCE_FILE:0)

Solution

  • Adding to :aot in the project.clj file worked for me.

    :aot [clojure.tools.logging.impl ...]