为什么在调试JBoss时Eclipse跳过行? [英] Why does Eclipse skip lines when I debug JBoss?

查看:76
本文介绍了为什么在调试JBoss时Eclipse跳过行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调试在后台使用JMS的Web服务调用.我在调试模式下运行了JBoss.发生的是,当我在Eclipse中按F6键(执行当前行)时,它跳过了某些行.我有这种方法:

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);
    }

那会发生什么呢?我在第1行有断点.当我按F6键时,它将跳过该行并转到第3行.当我再次按F6键时,它将转到方法的结尾.一半的代码永远不会执行.. ???我的问题是为什么.我假设我的源代码与正在执行的真实代码没有很好的联系,但是我该如何更改呢?

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?

谢谢.

推荐答案

通常,当您使用调试器查看的源与应用程序实际运行的代码版本不同时,就会发生这种情况.以前的版本可能在第1行和第3行有代码,在第2行有空白(或注释),而没有其他代码.确保已部署了最新代码(调试器配置为指向最新源)​​,并查看它是否仍会发生.

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.

这篇关于为什么在调试JBoss时Eclipse跳过行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆