本文介绍了延迟断点:何时加载类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 mvnDebug 之前,我试图调试maven: jdb -attach 8000

我尝试放置断点,但是得到:

  main [1]停在DeployMojo.DeployMojo 
延迟断点DeployMojo.DeployMojo。
它将在加载类后设置。
main [1]停在依赖关系:66
延期断点依赖关系:66。
它将在加载类后设置。

当我运行时,不会调用断点。我有源(使用maven命令生成),但是如何使它们可用于调试器?

是否有可以放置断点的类加载器?

解决方案

可能是因为您的类名称错误或因为您省略了包。
如果class 依赖关系在包 com.my.package 中,那么在class com.my.package.Dependency 而不是依赖关系


I am trying to debug maven with: jdb -attach 8000, after using mvnDebug.
I try to put breakpoints, but get:

main[1] stop in DeployMojo.DeployMojo
Deferring breakpoint DeployMojo.DeployMojo.
It will be set after the class is loaded.
main[1] stop at Dependency:66
Deferring breakpoint Dependency:66.
It will be set after the class is loaded.

When I run, the breakpoints are not called. I have the sources (generated with a maven command), but how can I make them available to the debugger?
Is there a class loader where I could put a breakpoint?

解决方案

This may happen because your class names are wrong or because you omitted the package.If class Dependency is in package com.my.package, then break in class com.my.package.Dependency and not in Dependency.

这篇关于延迟断点:何时加载类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 16:19