Java – line breakpoints do not work in some classes

I am using IntelliJ idea to debug applications running on Tomcat But I have a problem. In some classes, line breakpoints don't work (method breakpoints work properly... But slow) I can get a specific line of code or check variables by entering a class from a method breakpoint or from another class, but the debugger won't stop on any line (IntelliJ displays an empty red circle (no crossing))

Update: this issue is not limited to Tomcat I encountered the same problems as different projects on Weblogic So it's either an idea or Java problem

What are the possible reasons? There are no special compiler options. Linenumbertables and localvariabletables are there when I decompile the class These two classes (line breakpoints are good, one can't) are in the same package My source exactly matches the deployed code I have cleared all IntelliJ idea caches (also [system] / jars, here I suggest: debugger doesn't stop at source code in IntelliJ idea)

> Java 1.6. 0_ 43 (64 bit) > IntelliJ idea 12.1 3 > Tomcat 6.0. 36 > Debian test > it is suitable for other developers using windows, so this is not a problem with the project

When I enable debugger tracing in idea as recommended by crazycoder, I get these results (show output when I add / remove line breakpoints in my idea):

The grade is very good

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

Bad grade

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

Solution

I have exactly the same problem and just solved it - I don't know if your settings are the same, but my problem is that my class files are exported to a folder under the content root directory of my module (even if I do have a folder marked as excluded in my module settings)

I deleted all local class files, updated the compiler output settings to point to my content root, rebuilt the project, and now everything works as expected

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>