-
Notifications
You must be signed in to change notification settings - Fork 49
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
All evaluations in Debug Shell fail with "ClassNotFoundException" #295
Comments
I tried a simple test on my current Eclipse which is 2023-09 M3. Using the following test:
I had a breakpoint set at the first println in foo(). I then had the following in my Debug Console:
Highlighting each line separately and doing right-click Display, all 3 lines work. The println ends up printing to the Console, the compare ends up printing (int)1 in the console as does selecting 1 and doing Display. Does this simple test work for you? If yes, can you provide details on your particular test class? |
I have no particular test class. I see this for every application I attempt to debug. I will set up this sample as a project and test that. |
Either installation or workspace must be corrupted in some way. |
That test case has no problem. It happens with my applications, which are all much larger than this sample. As I said, there is nothing in the error log. |
Instead of using Debug Shell, Can you try using Expression View or simple Inspect after hitting at the breakpoint? |
Ok, good idea. I also thought it would be useful to set a breakpoint at the first line of the main method. That got some curious results. At that point, I entered "args" in the Debug Shell, selected it, and executed "Display". That time, instead of just printing ClassNotFoundException in the debug shell, it actually hit a breakpoint at the point where it was throwing the CNFE, which had some useful information. The following is a picture that shows some useful things: Note that I have "cn" selected in the Variables view, and nothing is shown in the bottom box, even though the right side clearly shows it is a string value, showing the name of a Groovy class. You'll also see that I was hovering over the "cn" expression in the code, and that also shows the class name, and no value is shown in the bottom box. The class name appears to be "org.codehaus.groovy.runtime.ScriptBytecodeAdapter". Note that I found no way to copy that string to the clipboard from either the Variables view or the expression view. It never showed the value in the bottom box, and there wasn't any way to select it. As this hit the breakpoint where it was throwing the CNFE, here is the stacktrace for it:
I have no idea whether that class is significant. I do have the groovy-eclipse plugin installed. Is this a problem with that plugin? |
Yes, advanced source lookup is turned on. Should I try turning it off? Do you mean take screenshots of every tab of the launch config? This is a maven application. It has all of the maven dependencies. It has the "Maven Dependencies" specified in the classpath as expected. |
However, this did give me a clue to explore. I recently had to make a change to the configuration of the groovy-eclipse plugin, which often causes problems for me, changing from Groovy 3 to Groovy 4. However, I see that some of our artifacts depend on Groovy 3. I have no idea why this would cause all debug shell evaluations to fail, but it seems like it might be related. I'm going to try changing the config back to Groovy 3, which will result in me having to reset many project configs and recompile everything. In a few hours I'll be able to see if this made any difference. |
Ok, that led to the solution. I also asked about this problem on the groovy-eclipse github, and they pointed me to this: https://github.com/groovy/groovy-eclipse/wiki/5.0.0-Release-Notes#debug-support . I added that flag setting to the eclipse.ini, and I also backed up from Groovy 4 to Groovy 3. I think it was probably the former that fixed this, but I guess I will move Groovy back to version 4 to confirm that. |
Closing |
Using Eclipse 2023-06.
Any expression that I highlight in the Debug Shell and select "Display" fails with:
The expression doesn't have to be complicated at all. I tried simply "1". Same result. I looked in the Eclipse log, and there is nothing coinciding with this.
I'm testing this while sitting at a breakpoint while debugging an application. I've tried this many times, with many expressions, and they all fail in the same way.
The text was updated successfully, but these errors were encountered: