Publish new release? Exception in thread "main" java.lang.NoClassDefFoundError: clojure/tools/logging/impl/LoggerFactory · Issue #37 · tatut/clj-chrome-devtools · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we add [clj-chrome-devtools "20220405"] to our app , we get an exception when we try to log in our AOT compiled app:
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/tools/logging/impl/LoggerFactory
When I use clj-chrome-devtools as a git dependency, or build the JARs myself, I can't reproduce the issue. The one thing I saw that looked odd was that in the deployed JAR there is a user.clj file which doesn't appear to be present in the source.
(ns user
(:require [clj-chrome-devtools.commands.page :as page]
[clj-chrome-devtools.core :as chrome]
[clj-chrome-devtools.automation :as auto]
[clj-chrome-devtools.automation.launcher :as launcher]
[clojure.java.io :as io])
(:import (java.util Base64)))
(comment
(defn b64-decode
"https://stackoverflow.com/a/39188819/53790"
[to-decode]
(.decode (Base64/getDecoder) to-decode))
(def a (launcher/launch-automation {}))
;(def c (chrome/connect "localhost" 9222))
;(def a (auto/create-automation c))
(auto/to a "https://babashka.org")
(auto/print-pdf a "bb.pdf")
(def resp (page/print-to-pdf c {}))
(def pdf-data (b64-decode (:data resp)))
(with-open [out (io/output-stream "test.pdf")]
(.write out pdf-data))
(def scr (page/capture-screenshot c {:format "png"}))
(with-open [out (io/output-stream "scr.png")]
(.write out (b64-decode (:data scr)))))
When I add that user.clj file to the repository and lein install, I can reproduce the crash. I'm not 100% sure what is going on here, but I think there is likely some issue with the user.clj file and our AOT compiled app.
My best guess is that user.clj is loaded first at boot, which loads clj-chrome-devtools.automation.launcher :as launcher which then loads clojure.tools.logging, and somehow there is a class conflict from the AOT compiled defrecord vs the runtime compiled defrecord.
Would you consider doing a new release to Clojars? I prefer to use Maven dependencies over Git dependencies when they're available. Thanks!
The text was updated successfully, but these errors were encountered:
danielcompton
changed the title
Publish new release?
Publish new release? Exception in thread "main" java.lang.NoClassDefFoundError: clojure/tools/logging/impl/LoggerFactory
Mar 19, 2025
Uh oh!
There was an error while loading. Please reload this page.
When we add
[clj-chrome-devtools "20220405"]
to our app , we get an exception when we try to log in our AOT compiled app:When I use clj-chrome-devtools as a git dependency, or build the JARs myself, I can't reproduce the issue. The one thing I saw that looked odd was that in the deployed JAR there is a
user.clj
file which doesn't appear to be present in the source.When I add that
user.clj
file to the repository andlein install
, I can reproduce the crash. I'm not 100% sure what is going on here, but I think there is likely some issue with theuser.clj
file and our AOT compiled app.My best guess is that
user.clj
is loaded first at boot, which loadsclj-chrome-devtools.automation.launcher :as launcher
which then loadsclojure.tools.logging
, and somehow there is a class conflict from the AOT compiled defrecord vs the runtime compiled defrecord.Would you consider doing a new release to Clojars? I prefer to use Maven dependencies over Git dependencies when they're available. Thanks!
The text was updated successfully, but these errors were encountered: