简体   繁体   English

Eclipse 中的调试器不工作

[英]Debugger in Eclipse is not working

I'm trying debug servlet class in aem.我正在尝试在 aem 中调试 servlet 类。 But i got problem, breakpoint I check is not working.但是我遇到了问题,我检查的断点不起作用。

在此处输入图片说明

Can you please help me in this case ?在这种情况下,你能帮我吗?

Thanks all!谢谢大家!

Are you sure the doCode() method is being called?您确定正在调用 doCode() 方法吗? Is the log line getting printed?是否打印日志行?

If yes, it might be possible that you have skipped all breakpoints by going to Run -> Skip all breakpoints如果是,则您可能通过转到 Run -> Skip all breakpoints 跳过了所有断点

Still doesn't work?还是不行? Try to build again.尝试重新构建。 If build automatically is turned off, classes may not be refreshed.如果关闭自动构建,类可能不会刷新。 Code being executed could be different.正在执行的代码可能不同。

To start an AEM instance in debug mode, you usually have to append (according to Adobe documentation)-要在调试模式下启动 AEM 实例,您通常必须附加(根据 Adob​​e 文档)-

-Xmx512m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n Your start command should then look something like this- -Xmx512m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n你的启动命令应该看起来像这样 -

java -Xmx4096m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -jar <name-of-jar>.jar

In case the debugger is not working, there could be 2 common reasons (and maybe more!)-如果调试器不工作,可能有 2 个常见原因(也许更多!)-

  1. -Xmx - the value might be too low. -Xmx - 值可能太低。 Increase it to a higher value.将其增加到更高的值。 I usually use -Xmx4096m to assign 4GB of memory to my AEM instance.我通常使用-Xmx4096m为我的 AEM 实例分配 4GB 内存。

  2. You've probably skipped all breakpoints.您可能已经跳过了所有断点。 Just go to the debug window in your IDE (Eclipse or IntelliJ) and make sure "Skip all breakpoints" is not active只需转到 IDE(Eclipse 或 IntelliJ)中的调试窗口并确保“跳过所有断点”未处于活动状态

In case the debugger does not connect, then please check the port.如果调试器没有连接,请检查端口。 The debug configuration port should match the address=8000 in the start command.调试配置端口应与 start 命令中的address=8000匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM