我正在尝试在 Eclipse 中调试 Maven 测试。当我使用 Maven 选项 maven.surefire.debug 启动测试时,出现此错误:
ERROR: transport error 202: bind failed: Address already in use
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
/bin/sh: line 1: 27500 Abort trap
当我尝试在我的 shell 中启动调试时也是一样。
我尝试添加 maven 选项 forkMode=never,但我的焊接 Artifact 出现了另一个错误,如果没有 maven.surefire.debug 选项,我就没有这个错误:
Error loading Weld bootstrap, check that Weld is on the classpath
但是,Weld 在我的类路径中。
有什么想法吗?
最佳答案
杀死监听端口的进程:
这个命令应该列出监听所有端口的进程:
netstat -ano
-o
选项将显示进程 ID。
如果您使用的是 *nix 系统,您可以进一步改进:
netstat -ano | grep <badport>
当您拥有进程 ID 时,您可以通过以下方式终止它:
window :
- 打开任务管理器,使用“查看”>“选择列”>“PID”添加 PID 列
- 找到进程,右键杀掉
其他:
kill <PID>
关于java - Maven Eclipse 调试 "JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29488424/