[英]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 设置远程调试的步骤:
JBP_CONFIG_DEBUG: '{enabled: true}'
environment variable for the application.JBP_CONFIG_DEBUG: '{enabled: true}'
环境变量。cf ssh -N -T -L 8000:localhost:8000 <APP_NAME>
cf ssh -N -T -L 8000:localhost:8000 <APP_NAME>
设置本地端口转发到我的应用程序容器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.