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
java.lang.NoClassDefFoundError: Could not initialize class #273
Comments
Hmm I have seen this error before but IIRC it was related to AOT compilation which is not active anymore. Can you reproduce this reliably? I have no idea where to look. |
I'm still trying to reproduce this issue, but in mean time will keep updating this issue as I encounter it. What I've found now is that sometimes if this error happens, and I press CTRL-C, the server hangs on I have to close the terminal when this happens, as it does not want to shut down at all. If I want to clean slate everything related to shadow-cljs, is it enough to delete the I can probably try deleting the |
All state is in I have no idea why the shutdown might fail. The next time it does please include a Do you use |
No, just using plain shadow-cljs. I run I then just use emacs to evaluate code. Thought I'd just clean everything out to ensure that I don't have some old files laying around somewhere that might be causing this, as I've been using shadow-cljs for a couple of months now. Here's another exception that I'm getting every now and then, it seems related:
|
This is so extremely strange ... There is not a single use of I am suspecting |
I think I'm able to reproduce it now.
It seems likely that it is something to do with cider, because if take cider out of the equation by running the following:
And then add the syntax error, it displays the correct syntax error information, as I would expect. I will update cider to the latest version (0.17) as I'm running from trunk, and will report back if it happens again. |
Error is still there with latest version of cider. I'll continue investigating and will update if anything changes, or if it hangs indefinitely again. |
@mjmeintjes Did this work for you before and stopped working recently? I'm asking because I'm quite puzzled by the error in general and I don't recall any recent changes in CIDER that could cause something like this. |
@bbatsov Sorry, difficult to say when this error started. I only noticed it for the past couple of weeks. |
@thheller I've experienced the problem where shadow-cljs hangs after pressing CTRL-C again. I ran jstack, and got the following output: The reason that I stopped the server is because I got the following error any time code failed to compile:
|
@mjmeintjes Which shadow-cljs version is this and what was the command used to start shadow-cljs? Ahh .. probably still |
Upgraded to 2.3.20 when I got this error. But I've since updated to 2.3.23. Random thought: can it have something to do with reflection, because I'm getting the following warnings when starting shadow-cljs:
|
Those warnings are unrelated. Those are Java9 issues with the IO library Anyways, I still do not have the slightest clue about the |
Just an update on this: I've isolated this into a docker container, and I'm pretty sure that it is not specific to my computer. I've created a docker container with a clean emacs, with just the latest cider version installed, and created a minimal project, and the problem still occurs. Next step is now going to go through different cider versions to see if I can isolate when this problem started. |
Ok, so I've done some extensive research into this bug, as it is a bit of a show stopper for me. Here's what I found:
I have set up a docker-compose project that you can use to check this out. It is a bit involved, but there are instructions in the readme: At least for now, my most pressing problem is solved because I can fallback to manually running |
Sorry, seems I was wrong. The error still crops up when running |
Sorry for the spam on this issue. For now, the only solution seems to be to downgrade to cider 0.16. Unfortunately, that doesn't seem to be an easy thing to do (or at least I couldn't figure out how to do it easily). Finally, I found the easiest way is to use For anyone else wanting to do this, add the following to your emacs init file:
|
Ok, so after using cider 0.16 for a while without any problems, the issue is now cropping up again. |
There are almost no differences middleware-wise between CIDER 0.16 and 0.17, so I was quite surprised by your initial discovery. Are you certain that's something to do with CIDER, btw - perhaps it's some bug in shadow's nREPL middleware? |
I also wonder who exactly does the track state middleware play into all of this. The only thing from the log I'm familiar with is:
That's how CIDER keeps track of the state of the namespaces users interact with. |
It is absolutely possible that my middleware does something its not supposed to but the weird thing is that the error is happening in an entirely unrelated thread. In development "watch" mode a worker-thread is spawned which is responsible for coordinating the various events that can happen. The above message is sent from the classpath watch thread (another totally unrelated thread) when it finds modified files on the classpath and notifies the worker. The worker then processes the message and triggers a recompile which fails. @mjmeintjes can you test running |
@thheller That seems to solve the problem. |
I once thought I understood classloaders but I guess I don't. This was just a wild guess, not actually a clue why it would affect anything. Maybe some of the |
Some middleware uses dynapath to add a couple of jars to the classpath, but
I don’t recall any classloader manipulations. I can’t check right now.
On Thu, 24 May 2018 at 17:21, Thomas Heller ***@***.***> wrote:
I once thought I understood classloaders but I guess I don't. This was
just a wild guess, not actually a clue why it would affect anything. Maybe
some of the cider-nrepl middleware manipulates the classloaders?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#273 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGVyjwC_y3l6uk4tYFJm_O3zfT9xvZsks5t1sIEgaJpZM4Tz5l1>
.
--
Best Regards,
Bozhidar Batsov
http://www.batsov.com
|
I'll try to test several different versions of shadow-cljs over the weekend
to see if some specific change introduced this problem, or if it has always
been a problem.
… |
I have a new theory.
Maybe somehow some bindings "leak" into the worker threads. Not a clue how that would lead to a classloader problem but that would explain why it works when the |
async/thread keeps bindings which might be causing #273 when starting the watch from a REPL thread
I just release @mjmeintjes please try that if you get a chance. my emacs-fu is too weak to get this setup properly. |
Still giving the same error using 2.3.25. The only difference is that the error is now printing in the REPL buffer in emacs, which is an improvement over just displaying "Compiling...". It is also displaying the following line before the error.
|
I am getting this with 2.3.35:
|
|
Yes this fixes it for me! 🎉 |
Great. I still don't actually have a slightest clue what the actual problem is but removing the problematic |
I had the same I haven't used |
Shadow-cljs version 2.3.19
What happens:
I'm getting the following error when I recompile and there is some syntax error in my code. The compiling also seems to not finish when this happens.
I can provide more information if you let me know what you need.
After restarting server, and re-compiling, it shows me that I have an error in the repl:
What I would expect to happen:
I expect shadow-cljs to tell me that there is an syntax error in my code, without requiring me to restart the server.
Let me know if you require further information.
The text was updated successfully, but these errors were encountered: