[英]Remote Debugging in SAP Cloud Foundry
I am wondering how to remote debug a S4SDK/Spring 2.0.6 Java Application deployed in SAP Cloud Foundry. 我想知道如何远程调试在SAP Cloud Foundry中部署的S4SDK / Spring 2.0.6 Java应用程序。
I am using Eclipse (Spring Tool Suite) and started the app in Debug Mode. 我正在使用Eclipse(Spring工具套件),并在调试模式下启动了该应用程序。 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
应用程序将使用以下环境变量重新启动:-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). 控制台输出显示,启动后会自动成功创建SSH隧道(作为前提,我已使用cf enable-ssh启用了SSH)。 and 'Successful remote access by 10.0.136.5:34858'.
和“通过10.0.136.5:34858成功进行远程访问”。
After a few seconds, eclipse shows the message "Failed to connect to remote VM". 几秒钟后,eclipse会显示消息“无法连接到远程VM”。
How to enable remote debugging? 如何启用远程调试?
This depends a bit on the buildpack you are using (see this link ). 这取决于您使用的buildpack(请参阅此链接 )。
For the sap_java_buildpack
you need to do the following: 对于
sap_java_buildpack
您需要执行以下操作:
jvmmon
in your CF container: jvmmon
: cf ssh <app name> -c "app/META-INF/.sap_java_buildpack/sapjvm/bin/jvmmon"
In the opened CLI enter start debugging
. 在打开的CLI中输入
start debugging
。
(Optional) Enter print debugging information
to verify that debugging is enabled. (可选)输入
print debugging information
以确认已启用调试。
Exit the CLI with q
. 使用
q
退出CLI。
To open the ssh tunnel enter cf ssh <app name> -N -T -L 8000:127.0.0.1:8000
. 要打开ssh隧道,请输入
cf ssh <app name> -N -T -L 8000:127.0.0.1:8000
。
With that you can connect to your application via localhost:8000
by the usual means of your IDE. 这样,您可以使用IDE的常规方法通过
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. 由于我没有在Eclipse中进行远程调试的经验,因此我无法为您提供帮助,因此在IDEA中有一个特殊的“远程”配置,您可以在其中添加远程URL,因此本例中为
localhost:8000
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.