简体   繁体   中英

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. Below are the steps that I'm following to setup remote debug using eclipse:

  1. Setting up JBP_CONFIG_DEBUG: '{enabled: true}' environment variable for the application.
  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>
  3. Then I'm setting up the remote debug configuration in eclipse as shown below image: Eclipse remote debug setup

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)

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

我们也遇到了一些问题,但是有一个特定的 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}"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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