Running Debug in Java can't find CaptureAgent
Answered
I am attempting to run an application in Debug. It runs fine from the standard Run. However, when run from Debug, it generates a class not found:
com.intellij.rt.debugger.agent.CaptureAgent
I am running: Build #IC-181.5281.24 (built on June 12, 2018)
Although I would think that the IDE would automatically include any of its modules, I tried to explicitly include the debugger-agent.jar, but this made no difference.
I have run the debugger on this application in the past without a problem.
Thanks for any suggestions.
Edward.
Please sign in to leave a comment.
Hello Edward,
Please try to disable Instrumenting agent in "Settings | Build, Execution, Deployment | Debugger | Async Stacktraces"
Thanks for the quick response.
When I do that, it now can't find my main class.
Thanks,
Edward.
Edward,
Is it reproducible with other projects? Does it help to run "File | Invalidate Caches"?
Still no success with invalidated caches.
Unfortunately, I only have the one project that I can run standalone.
Thanks,
Edward.
Edward,
Could you please create new sample "Hello World" project and check if the issue occurs there? Did you remove debugger-agent.jar before disabling Instrumenting agent?
I created a test project and it ran in both the Run and Debug. Of course, this is much simpler than the complex application I am trying to debug. From the IDE's perspective, what is different in how it Runs vs. Debugs?
BTW, I removed the explicit inclusion of the debugger-agent.jar with the same results.
Thanks,
Edward,
Edward,
We have similar issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-188835. Please attach your idea.log ("Help | Show log in...") after restarting IDE and reproducing to that issue .
.
Thank you for the information. I ran it fresh and logged a comment on the track to which you referred.
While there are some features of IntelliJ that I like, I need to be able run the debugger. I moved to NetBeans, but still have hope.
Thanks,
Edward.
Edward,
Could you please attach one more log with disabled Instrumenting agent?
That log was with Instrumenting Agent disabled.
Thanks,
Edward.
Edward,
I don't see any compilation/build error in that log related to missing main class. When do you get that error? Could you please add more information about your project - frameworks, build tools used?
Если встречается такая проблема то нужно поставить в папку C:\Users\*имя пользователя Windows*\.IntelliJIdea2019.2 в исключения проверки антивирусом, у меня лично DrWeb мне "жизнь портил")))
последняя папка из-за версии IntelliJ IDEA может быть немного другая, нужно выбрать ту которую IDEA использует сейчас( если было несколько версий IDEA то у каждой своя папка)
It helped me, thank you. Dr.Web, too
Yaroslav Bedrov, тысяча благодарностей, вы меня здорово выручили!
I've the very same problem.
Exception:
detailMessage = com.intellij.rt.debugger.agent.CaptureAgent$KeyProvider
Running on Mac
IntelliJ IDEA 2020.1 (Ultimate Edition)
Build #IU-201.6668.121, built on April 8, 2020
Joerg, have you tried the solutions that Yaroslav described above?
Also, make sure that you have added the IntelliJ IDEA to the antivirus exclusions. Follow the links below to learn which folders should be added:
https://intellij-support.jetbrains.com/hc/en-us/articles/360005028939-Slow-startup-on-Windows-splash-screen-appears-in-more-than-20-seconds
https://intellij-support.jetbrains.com/hc/en-us/articles/360006298560-Antivirus-Impact-on-Build-Speed
For others who might be facing this issue, I noticed that it started happening after I enabled `Java Exception Breakpoints` to stop whenever the application being debugged hits any breakpoint. By default all caught and uncaught exceptions will trigger a breakpoint.
As Egor mentioned here, during normal running of an app there will be a lot of exceptions thrown, and it seems that the first exception thrown is `ClassNotFoundException` for com.intellij.rt.debugger.agent.CaptureAgent, and if the agent is disabled, then it fires next for the main class of the application. I guess these classes are found subsequently as the application boots up and the classpath is populated, but enabling breakpoints on all exceptions means you encounter the very first exceptions as well, thus blocking your debug workflow.
This also explains why the simple Run configuration works - the breakpoints are only hit during Debug mode.
Hope that helps!
This solved the issue for me. I must have accidentally enabled Java Line Breakpoints when I removed a set of breakpoints in the Breakpoints dialog.
Thanks!
hi have the same issue and Rob Bosman Nl+github suggest work for me
"This solved the issue for me. I must have accidentally enabled Java Line Breakpoints when I removed a set of breakpoints in the Breakpoints dialog."