Why does Eclipse skip lines when I debug JBoss?
I am trying to debug web service call which uses JMS in the background.I have JBoss runni开发者_高级运维ng in debug mode. What happens is that when I press F6 in Eclipse (to execute current line) it skips certain lines. I have this method:
@Override
public void log(MsgPayload payload) {
1 Date startTime = new Date();
logger.info("Publishing with BufferedPublisher.java start time:"+startTime);
3 publisher.send(payload);
Date endTime = new Date();
logger.info("Publishing with BufferedPublisher.java end time:"+endTime);
long mills = endTime.getTime()-endTime.getTime();
double secs = mills/1000.0;
logger.info("Publishing with BufferedPublisher.java total time (seconds):"+secs);
}
So what happens? I have breakpoint at line 1. When I press F6 it skips that line and goes to line 3. When I press F6 again it goes to the end of the method. Half of the code is never executed..??? My question is why. I am assuming my source is not well attached to the real code that is being executed.But how do I change this?
Thanks.
Often this happens when the source that you're looking at with the debugger isn't the same version of the code that the app is actually running. Potentially a previous version had code at lines 1 and 3, and whitespace (or comment) on line 2, and no other code. Make sure that you've got the most recent code deployed (and your debugger configured to point to the most recent source) and see if it still happens.
I've just solved similar problem. I had some external jars in my java build path that were bad configured. I fixed it, cleaned and rebuilded project. After that everything worked just fine.
I am running MyEclipse 9.1 and my problem was resolved by changing the .classpath file that is just under the project name directory. I do not know how it changed, but it was sending hot deploys into target.
Once the code was changed to deploy to the WEB-INF/classes, the debugger lines became synchronized and all worked well.
精彩评论