7

我正在使用 intellij Idea 来调试在 tomcat 上运行的应用程序。但是我有一个问题,在某些类中,行断点不起作用(方法断点工作正常......但速度很慢)。我可以通过从方法断点或另一个类进入类来访问特定的代码行或检查变量,但调试器不会在任何行上停止。(IntelliJ 显示空红色圆圈(无十字))

更新:这个问题不仅限于 Tomcat。我在不同项目的 Weblogic 上有同样的问题。所以这要么是Idea的问题,要么是Java的问题。

可能的原因是什么?没有特殊的编译器选项,当我反编译该类时,LineNumberTables 和 LocalVariableTables 就在那里。这两个类(一个行断点很好,一个没有)在同一个包中。我的来源与部署的代码完全匹配。我已经清除了所有 Intellij IDEA 缓存(还有 [system]/jars,这里建议:Debugger doesn't stop at source code in Intellij IDEA

  • Java 1.6.0_43(64 位)
  • IntelliJ 理念 12.1.3
  • 雄猫 6.0.36
  • Debian 测试
  • 它适用于使用 Windows 的其他开发人员,因此这不是项目的问题

当我按照 CrazyCoder 的建议在 Idea 中启用调试器跟踪时,我得到了这些结果(当我在想法中添加/删除行断点时显示输出):

没问题的班级

==== 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]

不好的班级

==== 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]
4

2 回答 2

3

我遇到了完全相同的问题并且刚刚解决了它-不知道您的设置是否相同,但我的问题是我的类文件正在输出到模块内容根目录下的文件夹中(即使我确实有在我的模块设置中标记为排除的文件夹)。

我删除了所有本地类文件,更新了编译器输出设置以指向我的内容根目录之外,重建了项目,现在一切都按预期工作。

于 2013-05-29T14:19:20.513 回答
2

我在 intelliJ Idea 服务台上获得了进一步的支持,但问题是暂时的?通过从我的本地 maven 存储库中删除 war 文件来修复。

于 2013-05-30T13:30:34.473 回答