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.

0
19 comments
Avatar
Yaroslav Bedrov

Hello Edward,

Please try to disable Instrumenting agent in "Settings | Build, Execution, Deployment | Debugger | Async Stacktraces"

 

5
Avatar
Permanently deleted user

Thanks for the quick response.

When I do that, it now can't find my main class.

Thanks,

Edward.

0
Avatar
Yaroslav Bedrov

Edward,

Is it reproducible with other projects? Does it help to run "File | Invalidate Caches"?

1
Avatar
Permanently deleted user

Still no success with invalidated caches.

Unfortunately, I only have the one project that I can run standalone.

Thanks,

Edward.

0
Avatar
Yaroslav Bedrov

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?

 

1
Avatar
Permanently deleted user

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,

0
Avatar
Yaroslav Bedrov

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 .

.

1
Avatar
Permanently deleted user

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.

0
Avatar
Yaroslav Bedrov

Edward,

Could you please attach one more log with disabled Instrumenting agent?

 

1
Avatar
Permanently deleted user

That log was with Instrumenting Agent disabled.

Thanks,

Edward.

0
Avatar
Yaroslav Bedrov

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?

1
Avatar
Permanently deleted user

Если встречается такая проблема то нужно поставить в папку C:\Users\*имя пользователя Windows*\.IntelliJIdea2019.2 в исключения проверки антивирусом, у меня лично DrWeb мне "жизнь портил")))

последняя папка из-за версии IntelliJ IDEA  может быть немного другая, нужно выбрать ту которую IDEA использует сейчас( если было несколько версий IDEA то у каждой своя папка)

1
Avatar
Permanently deleted user

It helped me, thank you. Dr.Web, too

0
Avatar
Permanently deleted user

Yaroslav Bedrov, тысяча благодарностей, вы меня здорово выручили!

0
Avatar
Permanently deleted user

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

0

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:

0
Avatar
Permanently deleted user

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!

1
Avatar
Permanently deleted user

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!

1

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."

0

Please sign in to leave a comment.