无法连接到远程 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

查看:30
本文介绍了无法连接到远程 VM.拒绝连接.尝试在 Flash Builder 4.7 中调试远程 Java 应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某一时刻,远程调试曾经可以工作.但对于我的生活,我似乎无法弄清楚是什么打破了它.

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.

我有一个 flex/Java 应用程序.有一个包装器可以启动 tomcat 服务器.我修改了 wrapper.conf 文件以包含

I have a flex/Java application. There is a wrapper that starts the tomcat server. I modified the wrapper.conf file to include

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

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

在我的 flex 调试配置中,在左侧,我有远程 Java 应用程序.在右侧,我将标准(套接字连接)作为连接类型,将 127.0.0.1(我也尝试过 localhost)作为主机,将 8000 作为端口.

In my flex debug configurations, on the left, I have Remote Java Application. 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.

以下是堆栈跟踪.

!ENTRY org.eclipse.jdt.launching 4 113 2013-09-03 11:30:49.109!MESSAGE 无法连接到远程 VM.拒绝连接.!堆栈 0java.net.ConnectException:连接被拒绝:连接在java.net.PlainSocketImpl.socketConnect(Native Method) 在java.net.PlainSocketImpl.doConnect(Unknown Source) atjava.net.PlainSocketImpl.connectToAddress(Unknown Source) atjava.net.PlainSocketImpl.connect(Unknown Source) atjava.net.SocksSocketImpl.connect(Unknown Source) atjava.net.Socket.connect(Unknown Source) atjava.net.Socket.connect(Unknown Source) atjava.net.Socket.(Unknown Source) atjava.net.Socket.(Unknown Source) atorg.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136)在 java.lang.Thread.run(Unknown Source)

!ENTRY org.eclipse.jdt.launching 4 113 2013-09-03 11:30:49.109 !MESSAGE Failed to connect to remote 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)

这是调试配置的屏幕截图.

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. 我在 catalina.properties 文件中添加了 tomcat.enable.debug=true.
  2. 在我的 wrapper.conf 中,我有以下几行.

  1. I added tomcat.enable.debug=true to my catalina.properties file.
  2. In my wrapper.conf, I had the following lines.

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

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

我的 MaxPermSize 设置为小于 Xmx 的大小.我不得不将 1024 更改为 2048.

My MaxPermSize was set to a smaller size than Xmx. I had to change that 1024 to 2048.

然后我重新启动了我的 tomcat,它终于成功了!

I then restarted my tomcat and it worked, finally!

这篇关于无法连接到远程 VM.拒绝连接.尝试在 Flash Builder 4.7 中调试远程 Java 应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆