SAP Cloud Foundry中的远程调试 [英] Remote Debugging in SAP Cloud Foundry
问题描述
我想知道如何远程调试部署在SAP Cloud Foundry中的S4SDK/Spring 2.0.6 Java应用程序.
I am wondering how to remote debug a S4SDK/Spring 2.0.6 Java Application deployed in SAP Cloud Foundry.
我正在使用Eclipse(Spring工具套件),并在调试模式"下启动了该应用程序.应用程序将使用以下环境变量重新启动:-Dspring.devtools.remote.secret = secret -Xdebug -Xrunjdwp:server = y,transport = dt_socket,suspend = n,address = 47822
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
控制台输出显示,启动后会自动成功创建SSH隧道(作为前提条件,我已使用cf enable-ssh启用了SSH).和成功通过10.0.136.5:34858进行远程访问".
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'.
几秒钟后,eclipse显示消息无法连接到远程VM".
After a few seconds, eclipse shows the message "Failed to connect to remote VM".
如何启用远程调试?
推荐答案
This depends a bit on the buildpack you are using (see this link).
对于sap_java_buildpack
,您需要执行以下操作:
For the sap_java_buildpack
you need to do the following:
- 在CF容器中运行
jvmmon
:
cf ssh <app name> -c "app/META-INF/.sap_java_buildpack/sapjvm/bin/jvmmon"
在打开的CLI中输入start debugging
.
(可选)输入print debugging information
以确认已启用调试.
(Optional) Enter print debugging information
to verify that debugging is enabled.
使用q
退出CLI.
要打开ssh隧道,请输入cf ssh <app name> -N -T -L 8000:127.0.0.1:8000
.
To open the ssh tunnel enter cf ssh <app name> -N -T -L 8000:127.0.0.1:8000
.
因此,您可以使用IDE的常规方法通过localhost:8000
连接到您的应用程序.
With that you can connect to your application via localhost:8000
by the usual means of your IDE.
由于我没有在Eclipse中进行远程调试的经验,因此我无法为您提供帮助,在IDEA中,有一个特殊的远程"配置,您可以在其中添加远程URL,因此在这种情况下为localhost:8000
.
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.
这篇关于SAP Cloud Foundry中的远程调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!