简体   繁体   English

无法连接到远程VM。 拒绝连接。 尝试在Flash Builder 4.7中调试远程Java应用程序时

[英]Failed to connect to remote VM. Connection refused. when trying to debug remote java application in Flash Builder 4.7

At one point, the remote debug used to work. 有一次,远程调试曾经工作过。 But for the life of me, I don't seem to be able to figure out what broke it. 但对于我的生活,我似乎无法弄清楚是什么打破了它。

I have a flex/Java application. 我有一个flex / Java应用程序。 There is a wrapper that starts the tomcat server. 有一个启动tomcat服务器的包装器。 I modified the wrapper.conf file to include 我修改了wrapper.conf文件以包含

-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Xdebug -Xrunjdwp:transport = dt_socket,address = 8000,server = y,suspend = n

In my flex debug configurations, on the left, I have Remote Java Application. 在我的flex调试配置中,在左侧,我有远程Java应用程序。 On the right, I have Standard (Socket Attach) as the connection type, 127.0.0.1 (I have tried localhost too) as Host, and 8000 as Port. 在右边,我有标准(Socket Attach)作为连接类型,127.0.0.1(我也试过localhost)作为主机,8000作为端口。

The following is the stack trace. 以下是堆栈跟踪。

!ENTRY org.eclipse.jdt.launching 4 113 2013-09-03 11:30:49.109 !MESSAGE Failed to connect to remote VM. !ENTRY org.eclipse.jdt.launching 4 113 2013-09-03 11:30:49.109!MESSAGE无法连接到远程VM。 Connection refused. 拒绝连接。 !STACK 0 java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.(Unknown Source) at java.net.Socket.(Unknown Source) at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136) at java.lang.Thread.run(Unknown Source) !STACK 0 java.net.ConnectException:连接被拒绝:连接java.net.PlainSocketImpl.socketConnect(本机方法),java.net.PlainSocketImpl.doConnect(未知来源),位于java.net.PlainSocketImpl.connectToAddress(未知来源)at at来自java.net.Socket.connect(Unknown Source)的java.net.SocksSocketImpl.connect(未知源)java.net上的java.net.Socket.connect(未知源)java.net中的java.net.Socket.connect(未知源)。 net.Socket。(Unknown Source)at java.net.Socket。(Unknown Source)at org.eclipse.jdi.internal.connect.SocketTransportService $ 2.run(SocketTransportService.java:136)at java.lang.Thread.run(未知来源)

Here is a screen shot of the debug configurations. 以下是调试配置的屏幕截图。 屏幕截图的调试配置

After much struggles, I finally got it figured out. 经过多次挣扎,我终于明白了。 I had to make two changes. 我不得不做两处改动。

  1. I added tomcat.enable.debug=true to my catalina.properties file. 我在我的catalina.properties文件中添加了tomcat.enable.debug = true。
  2. In my wrapper.conf, I had the following lines. 在我的wrapper.conf中,我有以下几行。

    wrapper.java.additional.9="-Xmx2048m" wrapper.java.additional.10="-XX:MaxPermSize=1024m" wrapper.java.additional.9 =“ - Xmx2048m”wrapper.java.additional.10 =“ - XX:MaxPermSize = 1024m”

My MaxPermSize was set to a smaller size than Xmx. 我的MaxPermSize设置为小于Xmx的大小。 I had to change that 1024 to 2048. 我不得不将1024更改为2048。

I then restarted my tomcat and it worked, finally! 然后我重新启动了我的tomcat,它终于工作了!

Each debug argument must be placed in a line by itself, after the -vm argument. 在-vm参数之后,每个调试参数必须单独放在一行中。 This should do the trick: 这应该做的伎俩:

-vmargs
-Xdebug 
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000

Eclipse is not very verbose for this error "Connection refused". Eclipse对于此错误“连接被拒绝”并不是非常冗长。 One has to check three entries here. 一个人必须在这里检查三个条目。
1. Fully qualified host name or IP 1.全限定主机名或IP
2. Correct port number. 2.更正端口号。
3. At Tomcat level heck below: 3.在Tomcat级别下面:

Some versions of Tomcat has "dt_shmem" entry instead of "dt_socket". 某些版本的Tomcat具有“dt_shmem”条目而不是“dt_socket”。 Change it to dt_socket in catalina.bat. 在catalina.bat中将其更改为dt_socket。 The line should looks like this: 该行应如下所示:
set JPDA_TRANSPORT=dt_socket

We must start Tomcat in remote mode rightly, otherwise just setting related variable cannot solve the problem. 我们必须正确地以远程模式启动Tomcat,否则只是设置相关变量无法解决问题。 My solution is below and that works for my situation: Connection refused problem solution 我的解决方案在下面,适用于我的情况: 连接拒绝问题解决方案

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

相关问题 连接远程虚拟机失败。 拒绝连接。 在glassfish上进行远程调试 - Failed to connect to remote VM. Connection refused. on glassfish for remote debugging 远程调试:无法连接到远程 VM。 连接超时 - Remote Debugging: Failed to connect to remote VM. Connection timed out eclipse:applet浏览器调试:无法连接到远程VM。 拒绝连接 - eclipse: applet browser debugging: failed to connect to remote VM. Connection refused Flash Builder 4.7中Flex / Java应用程序的远程调试Java部分 - Remote Debug Java part of the Flex/Java application within Flash Builder 4.7 尝试连接 Java Spring 应用程序到远程 MongoDB 时出现异常打开套接字,连接被拒绝 - Exception opening socket, connection refused, when trying to connect Java Spring Application to a remote MongoDB 连接远程虚拟机失败 - Failed to connect to remote VM Eclipse在调试模式下启动Weblogic错误:“无法连接到远程VM” - Eclipse Start Weblogic in debug Mode error : “Failed to connect to remote VM” 尝试使用Java在远程服务器中连接HBase时出现连接问题 - Connection issue when trying to connect HBase in remote server using java 尝试通过远程计算机连接到DB时,SQL Server连接被拒绝 - SQL server connection refused when trying to connect to DB through a remote computer 远程调试Eclipse:无法连接到远程VM - Remote Debugging Eclipse : Failed to connect to remote VM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM