Error occurred while debugging in eclipse using JVM
2009-06-05 10:43
609 查看
ERROR: transport error 202: connect failed: No route to host
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]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Solution
This problem still exists in Intrepid, so here's a workaround. This
also fixes problems connecting to processes using JConsole and
debugging in NetBeans.
The trouble is in /etc/hosts. Ubuntu places "127.0.0.1
<hostname-you-picked-when-you-installed>" in there by default.
For whatever reason, with this default setup, Ubuntu is unable to
report hostname properly. If you issue hostname -i to get the IP
address, it reports a nonsense address, not the DHCP'd address, and not
even the address of the DHCP host. So the solution is to associate your
actual IP address with <hostname-you-picked-when-you-installed>
in /etc/hosts.
For me, I'm behind NAT, so I set up a static IP address and I replaced the default /etc/hosts line with this:
127.0.0.1 localhost.localdomain localhost
192.168.1.4 toodles-laptop
Then when I issue hostname -i the system reports 192.168.1.4 and Java
is happy making JMX and debug connections. JConsole works, and I can
debug in both Eclipse and NetBeans.
This will also work using DHCP (as opposed to assigning a static IP),
but only till the DHCP server gives you a new IP address. Then you'll
have to update /etc/hosts again, reboot and hope you get the same IP
address :) If anyone knows how to do this properly with DHCP, please
correct me here.
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]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Solution
This problem still exists in Intrepid, so here's a workaround. This
also fixes problems connecting to processes using JConsole and
debugging in NetBeans.
The trouble is in /etc/hosts. Ubuntu places "127.0.0.1
<hostname-you-picked-when-you-installed>" in there by default.
For whatever reason, with this default setup, Ubuntu is unable to
report hostname properly. If you issue hostname -i to get the IP
address, it reports a nonsense address, not the DHCP'd address, and not
even the address of the DHCP host. So the solution is to associate your
actual IP address with <hostname-you-picked-when-you-installed>
in /etc/hosts.
For me, I'm behind NAT, so I set up a static IP address and I replaced the default /etc/hosts line with this:
127.0.0.1 localhost.localdomain localhost
192.168.1.4 toodles-laptop
Then when I issue hostname -i the system reports 192.168.1.4 and Java
is happy making JMX and debug connections. JConsole works, and I can
debug in both Eclipse and NetBeans.
This will also work using DHCP (as opposed to assigning a static IP),
but only till the DHCP server gives you a new IP address. Then you'll
have to update /etc/hosts again, reboot and hope you get the same IP
address :) If anyone knows how to do this properly with DHCP, please
correct me here.
相关文章推荐
- Eclipse使用axis2生成客户端调用时最后一步出现an error occurred while completing process -java.lang.reflect.InvocationTargetException
- Eclipse : An error occurred while filtering resources
- Eclipse启动报错[ out of memory error has occurred ]或[ An internal error occurred while showing an internal error ]
- 解决eclipse-an-error-occurred-while-filtering-resources
- Eclipse Maven project 错误解决:An error occurred while filtering resources
- Android问题集锦之二十二:An error occurred while automatically activating bundle com.android.ide.eclipse.adt
- Eclipse 安装 activiti 插件 失败 An error occurred while collecting items to be installed
- VMProcessPageFault Error: Page fault occurred while in power handler! Address = 0x40314228解決方法
- eclipse 启动报错“An error occurred while automatically activating bundle com.android.ide.eclipse.adt (84
- Android问题集锦An error occurred while automatically activating bundle com.android.ide.eclipse.adt .
- Android问题集锦之An error occurred while automatically activating bundle com.android.ide.eclipse.adt
- The error may involve XXX(包)-Inline && The error occurred while setting parameters
- 日积月累:配置SDK路径错误(An error occurred while automatically activating bundle com.android.ide.eclipse.adt)
- 升级Eclipse出错的解决办法“Updating Software” has encountered a problem: An error occurred while uninstalling
- org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automati
- 关于VMProcessPageFault Error: Page fault occurred while in power handler!
- jacoco offline - error occurred in JaCoCo report. Error while creating report ***.class instrumented
- An error occurred while automatically activating bundle com.android.ide.eclipse.adt(259).
- Eclipse在线安装 报错 An error occurred while collecting items to be installed
- An error occurred while automatically activating bundle com.android.ide.eclipse.adt