简体   繁体   English

无法使用Eclipse开始调试Java应用程序

[英]Unable to start debugging a java application using eclipse

I have a java application which I am trying to debug using eclipse. 我有一个Java应用程序,正在尝试使用Eclipse进行调试。 When I launch debugging, I see this error message in the console: 启动调试时,在控制台中看到以下错误消息:

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)
ERROR: transport error 202: connect failed: Connection refused ["transport.c",L41]
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initialized

I am NOT trying to remotely debug the java application. 我不是要远程调试Java应用程序。 My java application is set up as a project in eclipse itself. 我的Java应用程序被设置为Eclipse本身中的一个项目。 I created a debug configuration and attempted to launch the application using it. 我创建了一个调试配置,并尝试使用它启动应用程序。

Having looked at various options on this forum, I tried pinging localhost and 127.0.0.1. 在查看了该论坛上的各种选项后,我尝试对localhost和127.0.0.1进行ping操作。 Both of them have succeeded (pinged with no issues). 他们两个都成功(没有任何问题)。 I do not have a clue on why this is happening. 我不知道为什么会这样。

The debugging is however working for a simple test class! 但是,调试仅适用于简单的测试类!

At the time of failure, this is what I see in eclipse log: 在发生故障时,这是我在eclipse日志中看到的内容:

eclipse.buildId=4.4.1.M20140925-0400
java.version=1.7.0_71
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_IE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product

org.eclipse.jdt.launching
Error
Mon Dec 29 15:24:26 GMT 2014
Cannot connect to VM

com.sun.jdi.connect.TransportTimeoutException
    at org.eclipse.jdi.internal.connect.SocketTransportService.accept(SocketTransportService.java:105)
    at org.eclipse.jdi.internal.connect.SocketTransportImpl.accept(SocketTransportImpl.java:59)
    at org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.accept(SocketListeningConnectorImpl.java:153)
    at org.eclipse.jdt.internal.launching.StandardVMDebugger$ConnectRunnable.run(StandardVMDebugger.java:110)
    at java.lang.Thread.run(Unknown Source)
  • Eclipse versions used: Luna (4.4.1), Indigo (3.7.2) - both of them are failing 使用的Eclipse版本:Luna(4.4.1),Indigo(3.7.2)-两者均失败
  • JDK version configured for the project: jdk1.5.0_15 为项目配置的JDK版本:jdk1.5.0_15
  • Operating System: Windows 7, 64 bit 作业系统:Windows 7、64位
  • Firewall: none 防火墙:无
  • Tried launching eclipse using -vm argument in eclipse.ini, pointing to JRE 1.6.0_20. 尝试使用eclipse.ini中的-vm参数启动Eclipse,指向JRE 1.6.0_20。 That didn't work either 那也不行

Can someone please guide me on what the issue could be. 有人可以指导我解决这个问题吗。

Appreciate any help. 感谢任何帮助。 Thank you. 谢谢。

Ravi. 拉维。

Your error message as an entry in Eclipse's Debug FAQ: https://wiki.eclipse.org/Debug/FAQ#I_can_run_a_program_but_not_debug_it.3F.3F.3F 您的错误消息作为Eclipse的Debug FAQ中的条目: https : //wiki.eclipse.org/Debug/FAQ#I_can_run_a_program_but_not_debug_it.3F.3F.3F

A bit of background information: Eclipse (and every other IDE) always uses a socket to connect to a JVM to debug. 一些背景信息:Eclipse(和所有其他IDE)始终使用套接字连接到JVM进行调试。 It doesn't matter whether the JVM is on the same computer or not. JVM是否在同一台计算机上都没有关系。 That means your IP stack has to work, security settings must allow Java to open ports, etc. 这意味着您的IP堆栈必须正常工作,安全设置必须允许Java打开端口等。

This can fail for several reasons: 失败可能有以下几个原因:

  1. The port is used. 使用该端口。 This usually happens when you specify a port to use instead of letting Eclipse find one for you. 当您指定要使用的端口而不是让Eclipse为您找到端口时,通常会发生这种情况。
  2. A firewall or some other security software is denying Java to open ports 防火墙或其他安全软件拒绝Java打开端口
  3. Your network configuration has gone bad. 您的网络配置已变坏。 One case is that a trojan has added IP addresses into /etc/hosts (or your OS's variation of that) to redirect your traffic. 一种情况是,特洛伊木马已将IP地址添加到/etc/hosts (或您的操作系统的变体)中,以重定向流量。 For Windows, look into the folder %WINDOWS%\\system32\\drivers\\etc\\ 对于Windows,请查看文件夹%WINDOWS%\\system32\\drivers\\etc\\

    The important bit is that localhost resolves as 127.0.0.1 . 重要的一点是localhost解析为127.0.0.1

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

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