Remote Debugging in SAP Cloud Foundry

陌路散爱 提交于 2019-12-24 17:53:22

问题


I am wondering how to remote debug a S4SDK/Spring 2.0.6 Java Application deployed in SAP Cloud Foundry.

I am using Eclipse (Spring Tool Suite) and started the app in Debug Mode. The application will be restarted with the following environment variable: -Dspring.devtools.remote.secret=secret -Xdebug -Xrunjdwp:server=y,transport=dt_socket,suspend=n,address=47822

The console output shows, that after startup an SSH tunnel has automatically been created successfully (as a prerequisite I have enabled SSH using cf enable-ssh). and 'Successful remote access by 10.0.136.5:34858'.

After a few seconds, eclipse shows the message "Failed to connect to remote VM".

How to enable remote debugging?


回答1:


This depends a bit on the buildpack you are using (see this link).

For the sap_java_buildpack you need to do the following:

  1. Run the jvmmon in your CF container:
    cf ssh <app name> -c "app/META-INF/.sap_java_buildpack/sapjvm/bin/jvmmon"
    
  2. In the opened CLI enter start debugging.

  3. (Optional) Enter print debugging information to verify that debugging is enabled.

  4. Exit the CLI with q.

  5. To open the ssh tunnel enter cf ssh <app name> -N -T -L 8000:127.0.0.1:8000.

  6. With that you can connect to your application via localhost:8000 by the usual means of your IDE.

As I have no experience with remote debugging in Eclipse I cannot help you with that part, in IDEA there is a special "Remote" Configuration where you can add the remote URL, so localhost:8000 in this case.



来源:https://stackoverflow.com/questions/54169124/remote-debugging-in-sap-cloud-foundry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!