简体   繁体   English

IntelliJ 调试器:连接但未注意到代码何时遇到断点

[英]IntelliJ debugger: Connects but doesn't notice when code runs into breakpoints

I try to debug an application server (WebLogic) with IntelliJ IDEA 11.1 Ultimate.我尝试使用 IntelliJ IDEA 11.1 Ultimate 调试应用程序服务器 (WebLogic)。 The debugger configuration worked previously, I didn't change anything.调试器配置之前工作,我没有改变任何东西。

What happens is: IntelliJ tells me发生的事情是:IntelliJ 告诉我

Connected to the target VM, address: '[snip]:9009', transport: 'socket'连接到目标虚拟机,地址:'[snip]:9009',传输:'socket'

I can add and remove breakspoints, and they are marked with a check mark, so setting them seems to work.我可以添加和删除断点,它们标有复选标记,因此设置它们似乎有效。 By interacting with the web interface of my application, I try to hit the breakpoints I set.通过与我的应用程序的 web 界面交互,我尝试命中我设置的断点。 The breakpoint actually seem to stop the code from executing, but the IntelliJ debugger doesn't react.断点实际上似乎停止了代码的执行,但 IntelliJ 调试器没有反应。 The web interface of my application doesn't respond until I disconnect the debugger, but IntelliJ just doesn't seem to notice that this happens at all.在我断开调试器之前,我的应用程序的 web 接口没有响应,但 IntelliJ 似乎根本没有注意到这种情况。 I cannot interact with the debugger.我无法与调试器交互。 How can I figure out what goes wrong?我怎样才能弄清楚出了什么问题? Is there some debugging output of the IntelliJ debugger itself? IntelliJ 调试器本身是否有一些调试 output? Are there known solutions to this issue?这个问题有已知的解决方案吗?

Okay, solved it: I had a method breakpoint active. 好的,解决了它:我有一个方法断点活跃。 Apparently that slowed the whole debugging process down so much that I couldn't interact with the debugger. 显然,这使得整个调试过程变得非常缓慢,以至于我无法与调试器进行交互。 Once I removed the breakpoint, debugging worked again. 一旦我删除断点,调试再次工作。

I had a similar problem but with a slight variation. 我有一个类似的问题,但有一点点变化。 I can mark and remove the breakpoints, the debugger was connected, shows all the threads of the JVM but the execution does not stop for any breakpoint. 我可以标记并删除断点,调试器已连接,显示JVM的所有线程,但执行不会因任何断点而停止。

Also it shows the old breakpoints as valid even after the code has been changed. 此外,即使代码更改后,它也会将旧断点显示为有效。 It so happened, that even after un-deploying the war file, the break points are still shown as valid breakpoints. 事情就是这样,即使在取消部署war文件之后,断点仍然显示为有效的断点。 That was weird!! 那很奇怪!!

Just as a note, I was using CE as below: 就像一张纸条,我使用CE如下:
IntelliJ IDEA 2016.1.3 IntelliJ IDEA 2016.1.3
Build #IC-145.1617, built on June 3, 2016 Build#IC-145.1617,建于2016年6月3日
JRE: 1.8.0_65-b17 amd64 JRE:1.8.0_65-b17 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation JVM:Oracle Corporation的Java HotSpot(TM)64位服务器VM

I tried different things: 我尝试了不同的东西:

  1. Invalidate Cache. 无效缓存。
  2. Invalidate Cache and Restart 使缓存无效并重新启动
  3. Re-package the war and re-deployed it 重新打包战争并重新部署

None of the above worked. 以上都没有奏效。

After this, I tried deleting the .idea folder and recreated the project. 在此之后,我尝试删除.idea文件夹并重新创建项目。 This time it is created the .idea folder again with the configuration afresh. 这次重新配置再次创建.idea文件夹。

The breakpoints now worked. 断点现在奏效了。

I posted so that it would help others who would have the same case as mine. 我发布的内容是为了帮助那些与我有同样情况的人。

I had the same problem where my app didn't stop at breakpoints and all I had to was restart IntelliJ Idea. 我有同样的问题,我的应用程序没有停在断点处,所有我不得不重启IntelliJ Idea。 And voila, now it does stop at breakpoints. 瞧,现在它确实停在了断点处。

My application was running and on console, it printed: 我的应用程序正在运行并在控制台上打印:

Listening for transport dt_socket at address: 5005

Then, when I ran my IntelliJ debugger, it printed: 然后,当我运行我的IntelliJ调试器时,它打印出:

Connected to the target VM, address: '192.168.2.9:5005', transport: 'socket'

Which is still the same after restart, but somehow restart makes it right for IntelliJ. 重新启动后仍然是相同的,但不知何故重启使它适用于IntelliJ。

Happened to me after I yanked out one of my debug phones (being Android I need many phones to debug) and quickly whipped in another. 在我拿出我的一个调试手机(我是Android,我需要很多手机来调试)之后发生了我的事情,并迅速鞭打另一个。

It's happened before, and I usually either, 它发生在以前,我通常也是,

a) use Linux instead a)使用Linux代替

b) save for a bigger brand/better driver phone b)节省更大的品牌/更好的司机手机

c) adb kill-server / adb start-server c) adb kill-server / adb start-server

These have some measure of success and are preferable for me to recreating my project. 这些都有一定程度的成功,我更喜欢重新创建我的项目。 What I understand from Android support is I should be using a Nexus with Linux for any kind of support, which is pretty much obviating any cross compilation / debugging I would like to benefit from. 我从Android支持中理解的是,我应该使用带有Linux的Nexus进行任何类型的支持,这几乎可以避免任何我希望从中受益的交叉编译/调试。

Even the phone I yanked is now (24 hours later) refusing to honour breakpoints. 即使是我猛拉的手机现在(24小时后)拒绝兑现断点。

I had actually the same problem using Remote debugger. 我使用远程调试器实际上遇到了同样的问题。 I fixed it by clicking on "pause" button Picture is here 我通过点击“暂停”按钮固定它图片在这里

I had the same issue with you and my Java host cmd is started from raw java command java -cp...我和你有同样的问题,我的 Java 主机 cmd 是从原始 java 命令java -cp...

But the solution is more weird for me... I downloaded the maven sources and it works...但解决方案对我来说更奇怪......我下载了 maven 源并且它有效......

Before downloading sources, I tried use pause in debugger(because it never stop so I want to check where it goes) and it is continuously stuck in one line of code in my dependency jar. After source is downloaded, it is not stuck and the breakpoints works.....在下载源之前,我尝试在调试器中使用暂停(因为它永远不会停止所以我想检查它去了哪里)并且它一直停留在我的依赖项jar中的一行代码中。下载源后,它没有卡住并且断点有效.....

Hope this help for anyone.希望这对任何人都有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM