tags:

views:

46

answers:

1

Hi,

I am trying to debug web service call which uses JMS in the background.I have JBoss running 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.

+3  A: 

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.

nojo