Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obscure classloader problem in cider #177

Open
jdf-id-au opened this issue Feb 7, 2024 · 4 comments
Open

Obscure classloader problem in cider #177

jdf-id-au opened this issue Feb 7, 2024 · 4 comments

Comments

@jdf-id-au
Copy link

Hi, thanks again for a brilliant library.

I'm scratching my head about this one.

Using Clojure 1.11.1, OpenJDK 17, macOS 14.2.1, this works fine:

$ clj -M:examples
user=> (load "e28_canvas")

But using the same tools via CIDER in emacs (cider-jack-in-clj specifying the :examples alias, and running cider-load-buffer within e28_canvas.clj) gives an error (condensed):

[nREPL] Starting server via /usr/local/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.0.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.44.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[cider.nrepl/cider-middleware\]\"\]\}\}\} -M:cider/nrepl:examples
Loading /path/to/cljfx/examples/e28_canvas.clj...
=> Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: Could not initialize class javafx.scene.control.Slider

Sometimes it's Control rather than Slider. The exception originates from the call to create-props in create-composite-component in cljfx.composite.

This did not happen in the past, but I haven't been able to determine which change in which system component caused it!

Empirically the only difference betwen (System/getProperty "java.class.path") between the two is the presence of cider-related jars orchard, nrepl, logjam and cider-nrepl.

Is there an obvious way I can investigate this further?

@jm-g
Copy link

jm-g commented Feb 10, 2024

I do observe this problem as well. One additional remark I can paste the first example from cljfx's readme into the cider repl and it works. If I evaluate the same code from a buffer it fails.

@jdf-id-au
Copy link
Author

jdf-id-au commented Feb 10, 2024

I was also able to get it going by running nrepl within my project, starting it on the command line, and using cider-connect-clj... 🧐

Browsing cider issues, there was this (closed; more as context than explanation)

@vlaaad
Copy link
Contributor

vlaaad commented Feb 29, 2024

Could you try launching JDK from emacs and the command line and checking if (System/getProperty "os.arch") returns different results?

@jdf-id-au
Copy link
Author

Both x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants