简体   繁体   English

将 eclipse 远程调试器连接到转发的本地端口时,Cloud Foundry 应用程序的远程调试失败

[英]Remote Debug for Cloud Foundry application fails when connecting eclipse remote debugger to forwarded local port

I'm trying to remotely debug a Spring boot application deployed on a cloud foundry Instance.我正在尝试远程调试部署在云代工厂实例上的 Spring 启动应用程序。 Below are the steps that I'm following to setup remote debug using eclipse:以下是我使用 eclipse 设置远程调试的步骤:

  1. Setting up JBP_CONFIG_DEBUG: '{enabled: true}' environment variable for the application.为应用程序设置JBP_CONFIG_DEBUG: '{enabled: true}'环境变量。
  2. After that I'm setting up the local port forwarding to my app container with cf ssh -N -T -L 8000:localhost:8000 <APP_NAME>之后,我使用cf ssh -N -T -L 8000:localhost:8000 <APP_NAME>设置本地端口转发到我的应用程序容器
  3. Then I'm setting up the remote debug configuration in eclipse as shown below image: Eclipse remote debug setup然后我在Eclipse 中设置远程调试配置,如下图所示: Eclipse 远程调试设置

After that when I try to start remote debug session, It tried to connect to the app but fails with the message at the port forwarded terminal:之后,当我尝试启动远程调试会话时,它尝试连接到应用程序,但在端口转发终端上失败并显示消息:

connect to localhost:8000 failed: ssh: rejected: connect failed (dial tcp 127.0.0.1:8000: getsockopt: connection refused)连接到本地主机:8000 失败:ssh:拒绝:连接失败(拨号 tcp 127.0.0.1:8000:getsockopt:连接被拒绝)

Please help, if anyone has any clue about this error!!请帮助,如果有人对此错误有任何线索!!

You might have to restage the application for the change to take place, debug configuration to change.您可能必须重新暂存应用程序才能进行更改,调试配置才能更改。

You can use alternatively ssh into the container using cf ssh <application name> and check that the debug port is opened on not using netstat -an您可以使用cf ssh <application name>或者使用 ssh 进入容器,并检查调试端口是否在不使用netstat -an打开

我们也遇到了一些问题,但是有一个特定的 java buildback,但无论如何它也会对您有所帮助,请尝试:

cf set-env <app-name> JBP_CONFIG_JAVA_OPTS '[java_opts: "-XX:+ForceDebuggingOnDemand"]'

cf restage <app-name>

尝试像这样更改调试端口:

JBP_CONFIG_DEBUG "{enabled: true, port: 8001}"

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

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