简体   繁体   English

换行符在某些类中不起作用

[英]Line breakpoints don't work in some classes

I'm using intellij Idea to debug an application running on tomcat. 我正在使用intellij Idea来调试在tomcat上运行的应用程序。 But I have a problem that in some classes, the line breakpoints don't work(method breakpoints are working fine...but slow). 但我有一个问题,在某些类中,行断点不起作用(方法断点工作正常......但速度慢)。 I can get to the specific line of code or inspect variables by stepping in to the class from the method breakpoint or from another class, but the debugger doesn't stop on any line. 我可以通过从方法断点或从另一个类进入类来获取特定的代码行或检查变量,但调试器不会在任何行上停止。 (IntelliJ shows empty red circle(no cross)) (IntelliJ显示空的红色圆圈(没有交叉))

Update : This problem is not limited to Tomcat. 更新 :此问题不仅限于Tomcat。 I have the same issues on Weblogic with different project. 我在Weblogic上遇到了与不同项目相同的问题。 So it's either a problem of Idea or Java. 所以这可能是Idea或Java的问题。

What may be the possible reasons? 可能的原因是什么? There are no special compiler options and when I decompiled the class, the LineNumberTables and LocalVariableTables are there. 没有特殊的编译器选项,当我反编译类时,LineNumberTables和LocalVariableTables就在那里。 The two classes(the one where line breakpoints are fine and one where aren't) are in the same package. 这两个类(行断点很好,一个不行)在同一个包中。 My sources match the deployed code exactly. 我的源完全匹配已部署的代码。 I've cleared all intellij idea caches(also [system]/jars, which was suggested here: Debugger doesn't stop at source code in Intellij IDEA ) 我已经清除了所有intellij构思缓存(也是[system] / jars,这里建议: 调试器不会停在Intellij IDEA的源代码中

  • Java 1.6.0_43 (64bit) Java 1.6.0_43(64位)
  • IntelliJ Idea 12.1.3 IntelliJ Idea 12.1.3
  • Tomcat 6.0.36 Tomcat 6.0.36
  • Debian testing Debian测试
  • It works fine for other developer using Windows so it's not a problem of the project 它适用于使用Windows的其他开发人员,因此这不是项目的问题

When I enable debugger tracing in Idea as suggested by the CrazyCoder, I get these results(showing the output when I add/remove line breakpoint in idea): 当我按照CrazyCoder的建议在Idea中启用调试器跟踪时,我得到了这些结果(当我在想法中添加/删除行断点时显示输出):

Class which is fine 等级很好

==== Enable Breakpoint ====
[JDI: Sending Command(id=25172) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 suspendPolicy(byte): 1]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 5]
[JDI: Sending:                         classPattern(String): com.teamead.fwf.web.controller.ino.datauser.flightplan.EquipmentDefinition]
[JDI: Receiving Command(id=25172) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 23]
[JDI: Retrieving matching ReferenceTypes, sig=Lcom/teamead/fwf/web/controller/ino/datauser/flightplan/EquipmentDefinition;]
[JDI: Sending Command(id=25174) JDWP.VirtualMachine.ClassesBySignature]
[JDI: Sending:                 signature(String): Lcom/teamead/fwf/web/controller/ino/datauser/flightplan/EquipmentDefinition;]
[JDI: Receiving Command(id=25174) JDWP.VirtualMachine.ClassesBySignature]
[JDI: Receiving:                classes(ClassInfo[]): ]
[JDI: Receiving:                    classes[i](ClassInfo): ]
[JDI: Receiving:                    refTypeTag(byte): 1]
[JDI: Receiving:                    typeID(long): ref=7269]
[JDI: Receiving:                    status(int): 7]
[JDI: Looking up Class, signature='Lcom/teamead/fwf/web/controller/ino/datauser/flightplan/EquipmentDefinition;', id=7269]
[JDI: Sending Command(id=25176) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 2]
[JDI: Sending:                 suspendPolicy(byte): 2]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 7]
[JDI: Sending:                         loc(Location): com.teamead.fwf.web.controller.ino.datauser.flightplan.EquipmentDefinition:24]
[JDI: Receiving Command(id=25176) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 24]

==== Disable Breakpoint ====
[JDI: Sending Command(id=25178) JDWP.EventRequest.Clear]
[JDI: Sending:                 eventKind(byte): 2]
[JDI: Sending:                 requestID(int): 24]
[JDI: Receiving Command(id=25178) JDWP.EventRequest.Clear]
[JDI: Sending Command(id=25180) JDWP.EventRequest.Clear]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 requestID(int): 23]
[JDI: Receiving Command(id=25180) JDWP.EventRequest.Clear]

Class which is not fine 等级不好

==== Enable Breakpoint ====
[JDI: Sending Command(id=25182) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 suspendPolicy(byte): 1]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 5]
[JDI: Sending:                         classPattern(String): com.teamead.fwf.web.controller.ino.datauser.flightplan.FlightPlanBackingBean]
[JDI: Receiving Command(id=25182) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 25]
[JDI: Retrieving matching ReferenceTypes, sig=Lcom/teamead/fwf/web/controller/ino/datauser/flightplan/FlightPlanBackingBean;]
[JDI: Sending Command(id=25184) JDWP.VirtualMachine.ClassesBySignature]
[JDI: Sending:                 signature(String): Lcom/teamead/fwf/web/controller/ino/datauser/flightplan/FlightPlanBackingBean;]
[JDI: Receiving Command(id=25184) JDWP.VirtualMachine.ClassesBySignature]
[JDI: Receiving:                classes(ClassInfo[]): ]
[JDI: Receiving:                    classes[i](ClassInfo): ]
[JDI: Receiving:                    refTypeTag(byte): 1]
[JDI: Receiving:                    typeID(long): ref=7257]
[JDI: Receiving:                    status(int): 7]
[JDI: Looking up Class, signature='Lcom/teamead/fwf/web/controller/ino/datauser/flightplan/FlightPlanBackingBean;', id=7257]

==== Disable Breakpoint ====
[JDI: Sending Command(id=25186) JDWP.EventRequest.Clear]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 requestID(int): 25]
[JDI: Receiving Command(id=25186) JDWP.EventRequest.Clear]

I had exactly the same problem and have just worked around it - don't know if your setup is the same but my problem was that my class files were being output into a folder under the content root of my module (even though I did have the folder marked as excluded in my module settings). 我有完全相同的问题并且只是解决了它 - 不知道你的设置是否相同但我的问题是我的类文件被输出到我的模块的内容根目录下的文件夹中(即使我确实有我的模块设置中标记为已排除的文件夹)。

I deleted all my local class files, updated the Compiler Output settings to point outside my content root, rebuilt the project and now everything is working as expected. 我删除了所有本地类文件,更新了编译器输出设置以指向我的内容根目录,重建项目,现在一切都按预期工作。

I've received further support on intelliJ Idea servicedesk and the issue was temporarily? 我已经收到了对intelliJ Idea服务台的进一步支持,这个问题暂时存在? fixed by removing the war file from my local maven repository. 通过从我的本地maven存储库中删除war文件来修复。

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

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