The behavior is strange when debugging on eclipse.

Asked 2 years ago, Updated 2 years ago, 88 views

When I started tomcat and debug it with Eclipse, the behavior was strange, such as pausing to the line where I was writing a comment or moving to the processing in the conditional statement even though it was not true.I deleted all the breakpoints and tried debugging again, but there was no change.Do you have any countermeasures?

java eclipse

2022-09-30 21:28

2 Answers

The source code Eclipse refers to (classes that can be built) and the actual loaded class version are likely to be different.For example, the source code is MyBatis 3.4.0 and the class file (library containing ) is MyBatis 3.4.5.Classes that differ between versions may lose line count support when debugging.

For classes that cannot accommodate the number of rows, please check the following two points:

·Where is the source code that Eclipse is referring to?
·Where are the classes loaded by Tomcat (including libraries)?

When this becomes clear, please compare the versions of the two.If you don't know the version (or if you don't have one), you'll find out by decompiling the class file and comparing it to the source code.


2022-09-30 21:28

Can't I clean it and rebuild it?
If it's just a build, sometimes the previous one is still loaded...


2022-09-30 21:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.