Why does Eclipse skip lines when debugging JBoss?

I am trying to debug a call to a web service that uses JMS in the background. My JBoss is in debug mode. It happens that when I press F6 in Eclipse (to execute the 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 is going on? I have a breakpoint on 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 the code is never executed. ??? My question is why. I assume that my source is poorly linked to the real code that is executing. But how to change that?

Thanks.

+4
source share
3 answers

Often this happens when the source you are watching with the debugger is not the same version of the code that the application really works. Potentially, the previous version had code in lines 1 and 3, and a space (or comment) in line 2 and no other code. Make sure you have the latest code installed (and your debugger is configured to point to the latest source) and see if this all happens.

+5
source

I just solved a similar problem. I had some external banks in my java build path that were poorly configured. I fixed it, cleaned and restored the project. After that, everything worked fine.

+1
source

I am running MyEclipse 9.1, and my problem was resolved by modifying the .classpath file, which is only under the project names directory. I do not know how he changed, but he sent the hot deployments to the target.

As soon as the code was changed for deployment on WEB-INF / classes, the debugger lines became synchronized and everything went well.

0
source

All Articles