简体   繁体   English

Maven Eclipse 调试“JDWP Transport dt_socket 初始化失败,TRANSPORT_INIT(510)”

[英]Maven Eclipse Debug "JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)"

I'm trying to debug Maven tests in Eclipse.我正在尝试在 Eclipse 中调试 Maven 测试。 When I launch tests with the maven option maven.surefire.debug, I get this error :当我使用 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        

It is the same when I tried tu launch debug in my shell.当我在我的 shell 中尝试 tu launch debug 时也是如此。

I tried to add the maven option forkMode=never, and I get another error with my weld artifact that I do not have without the maven.surefire.debug option :我尝试添加 maven 选项 forkMode=never,并且我的焊接工件出现另一个错误,如果没有 maven.surefire.debug 选项,我就没有:

Error loading Weld bootstrap, check that Weld is on the classpath

However, Weld is on my classpath.但是,Weld 在我的类路径上。

Any ideas ?有任何想法吗 ?

To kill a process listening on a port:要终止侦听端口的进程:

This command should list processes listening on all ports:此命令应列出侦听所有端口的进程:

netstat -ano

The -o option will display the process id. -o选项将显示进程 ID。

If you're using a *nix system, you can refine a little further with:如果您使用的是 *nix 系统,您可以通过以下方式进一步完善:

netstat -ano | grep <badport> 

When you have the process id, you can terminate it with:当您拥有进程 ID 时,您可以使用以下命令终止它:

Windows:视窗:

  • Open Task Manager, add the PID column with View > Select Columns > PID打开任务管理器,使用查看 > 选择列 > PID 添加 PID 列
  • Find the process and right-click to kill it找到进程并右键杀死它

Others:其他:

kill <PID>

For Mac users:对于 Mac 用户:

Usually the problem is that another process keeps Maven debug port 5005 open.通常问题是另一个进程保持 Maven 调试端口 5005 打开。 So I checked which process keeps this port open by executing:所以我通过执行检查了哪个进程保持这个端口打开:

lsof -i tcp:5005

The output was:输出是:

COMMAND  PID        USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    9089 my_user    7u  IPv4 0xe88ec542fd4cffc9      0t0  TCP *:avt-profile-2 (LISTEN)

And then I killed the process:然后我杀死了这个过程:

kill -9 9089

If you want these 2 process to be able to run together, you'll have to change the Maven debug port of at least one of them.如果您希望这两个进程能够一起运行,则必须更改其中至少一个的 Maven 调试端口。 See: http://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html .请参阅: http : //maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html

Go to Debug configuration -> Remote Java Application -> Connect tab, check Allow termination of remote JVM .转到Debug configuration -> Remote Java Application -> Connect选项卡,选中Allow termination of remote JVM

Then, when you are going to restart the server/maven, go to Debug perspective and click the read / stop button.....然后,当您要重新启动服务器/maven 时,转到Debug perspective并单击read / stop按钮.....

There is a long time the question was asked but i had the same problem recently.这个问题被问了很长时间,但我最近遇到了同样的问题。

  1. Open Task Manager打开任务管理器

  2. Kill all "java.exe" process杀死所有“java.exe”进程

  3. Relaunch the mvn debug重新启动 mvn 调试

Hope it will help希望它会有所帮助

Just for documentation, I had the exact same error, running on my local:仅用于文档,我在本地运行时遇到了完全相同的错误:

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)错误:传输错误 202:绑定失败:地址已在使用 本机方法中的致命错误:JDWP 未初始化传输,jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) 错误:JDWP 传输 dt_socket 无法初始化,TRANSPORT_INIT(510)

in my case the port wasn't the issue, but the host file.在我的情况下,端口不是问题,而是主机文件。 The solution is to add/re-add/uncomment:解决方法是添加/重新添加/取消注释:

127.0.0.1 localhost 127.0.0.1 本地主机

The config file sets localhost as default, so a solution is add that host or change it for a custom one.配置文件将localhost设置为默认值,因此解决方案是添加该主机或将其更改为自定义主机。

To add on.. I had the similar issue last week, when debugging using eclipse was made impossible.补充一下……上周我遇到了类似的问题,当时使用 eclipse 进行调试变得不可能。

FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=AGENT_ERROR_TRANSPORT_LOAD(196)
ERROR: transport library not found: dt_socket
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_LOAD(509)
JDWP exit error AGENT_ERROR_TRANSPORT_LOAD(196): No transports initialized [../../../src/share/back/debugInit.c:690]

Sadly non of the solution I can possibly find online was helpful.可悲的是,我可能在网上找到的解决方案都没有帮助。

The issue turned out to be that somehow firewall removed all the dlls in my JRE bin... (so dt_socket.dll went completely missing).问题原来是防火墙以某种方式删除了我 JRE bin 中的所有 dll ......(因此 dt_socket.dll 完全丢失了)。

Reinstalling the entire JRE helped.重新安装整个 JRE 有帮助。

The solution to me was removing the breakpoints of project!我的解决方案是删除项目的断点! If you have many branches and changed recently sometimes eclipse lost some's breakpoints.如果你有很多分支并且最近发生了变化,有时 eclipse 会丢失一些断点。

first of all remove all debug points in eclipse首先删除eclipse中的所有调试点

search for PID with server port使用服务器端口搜索PID
netstat -ano|find /i "7001" netstat -ano|find /i "7001"
replace 7001 with your port number in above line用上面一行中的端口号替换 7001

sample o/p C:\\Users\\shaithal>netstat -ano|find /i "7001" TCP 127.0.0.1:51340 127.0.0.1:7001 SYN_SENT 17396示例 o/p C:\\Users\\shaithal>netstat -ano|find /i "7001" TCP 127.0.0.1:51340 127.0.0.1:7001 SYN_SENT 17396

then kill that process taskkill /F /PID 17396然后杀死该进程 taskkill /F /PID 17396

search for PID with debug port also netstat -ano|find /i "8453" 8453 is debug port in my case replace 8453 with your port number in above line搜索带有调试端口的PID netstat -ano|find /i "8453" 8453 在我的情况下是调试端口 用上面一行中的端口号替换 8453

sample o/p样品o/p

C:\\Users\\shaithal>netstat -ano|find /i "8453" TCP 0.0.0.0:8453 0.0.0.0:0 LISTENING 19904 C:\\Users\\shaithal>netstat -ano|find /i "8453" TCP 0.0.0.0:8453 0.0.0.0:0 聆听 19904

then kill that process taskkill /F /PID 19904然后杀死该进程 taskkill /F /PID 19904

暂无
暂无

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

相关问题 传输dt_socket 8787已在使用中 - Transport dt_socket 8787 already in use 如何继续“在地址处侦听运输dt_socket” - how to continue 'Listening for transport dt_socket at address' Maven Jgit JDWP传输错误 - Maven jgit JDWP transport error 远程调试Java程序时禁止显示“正在侦听传输dt_socket”消息 - suppress “listening for transport dt_socket” message when remote debugging Java programs 应用程序打印“侦听传输dt_socket地址:5005”并且不会停止 - Application prints “Listening for transport dt_socket at address: 5005” and does not halt Eclipse Mac OS X调试错误:“本机方法中的致命错误:JDWP没有传输初始化,jvmtiError = AGENT_ERROR_TRANSPORT_INIT(197)” - Eclipse Mac OS X Debug Error: “FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)” GlassFish 4 错误启动域 domain1 侦听传输 dt_socket 地址:9009 错误:无法找到或加载主类文件 - GlassFish 4 error starting domain domain1 listening for transport dt_socket at address: 9009 Error: could not find or load main class files 本机方法中的致命错误:JDWP没有传输初始化,jvmtiError = AGENT_ERROR_TRANSPORT_INIT(197) - FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) 使用transport = dt_shmem在Eclipse中调试Java应用程序 - Debugging Java application in Eclipse using transport=dt_shmem Jboss错误在调试时-本机方法中的致命错误:JDWP没有初始化传输,jvmtiError = AGENT_ERROR_TRANSPORT_INIT(197) - Jboss Error While debugging -FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM