【发布时间】:2019-09-22 19:21:42
【问题描述】:
我需要有关 intell J IDE 上远程调试选项的帮助,我已成功连接到 Digital Oceans VM 提供的远程主机,但我无法从我的 IDE 开始调试。
这是显示本地计算机 (Ubuntu 18.04) 上正确连接的图像:
之前我在远程主机(Ubuntu 18.04)上设置了我的 Spring Boot 的 VM 执行:
.../target# java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar balak-cliente-rest-0.0.1-SNAPSHOT.jar
Listening for transport dt_socket at address: 5005
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.6.RELEASE)
2019-09-22 18:22:55.904 INFO 11937 --- [ main] c.t.s.app.ClienteRestApplication : Starting ClienteRestApplication v0.0.1-SNAPSHOT on desarrollosfelipeinostroza with PID 11937 (/desarrollos/balak/tudicom-ws-rest/target/balak-cliente-rest-0.0.1-SNAPSHOT.jar started by root in /desarrollos/balak/tudicom-ws-rest/target)
2019-09-22 18:22:55.922 INFO 11937 --- [ main] c.t.s.app.ClienteRestApplication : No active profile set, falling back to default profiles: default
2019-09-22 18:23:02.905 INFO 11937 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$5e2153d6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-09-22 18:23:03.531 INFO 11937 --- [ main] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
2019-09-22 18:23:04.897 INFO 11937 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 7171 (http)
2019-09-22 18:23:05.135 INFO 11937 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-09-22 18:23:05.137 INFO 11937 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21]
2019-09-22 18:23:05.614 INFO 11937 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-09-22 18:23:05.618 INFO 11937 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 9280 ms
2019-09-22 18:23:07.371 INFO 11937 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-09-22 18:23:08.479 WARN 11937 --- [ main] o.s.x.transform.TransformerFactoryUtils : http://javax.xml.XMLConstants/property/accessExternalDTD property not supported by org.apache.xalan.processor.TransformerFactoryImpl
2019-09-22 18:23:08.479 WARN 11937 --- [ main] o.s.x.transform.TransformerFactoryUtils : http://javax.xml.XMLConstants/property/accessExternalStylesheet property not supported by org.apache.xalan.processor.TransformerFactoryImpl
2019-09-22 18:23:08.844 INFO 11937 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 7171 (http) with context path ''
2019-09-22 18:23:08.853 INFO 11937 --- [ main] c.t.s.app.ClienteRestApplication : Started ClienteRestApplication in 16.567 seconds (JVM running for 18.499)
然后我将 Postman 的请求发送到端点以开始调试,但远程服务器上的应用程序在我的 IDE 中都没有发生任何事情。 我在没有用于传输的 VM 参数的情况下进行测试,以验证来自邮递员的调用并且应用程序响应,但是当我输入这些参数时,邮递员无法随他的请求到达。
需要了解的重要事项:
- 本地机运行 openjdk 版本“1.8.0_222”(Ubuntu 18.04)
- 远程调试选项
- 在调试器菜单上,这是我的选项(本地 m.):
- 远程机器 openjdk 版本“11.0.4”(Ubuntu 18.04)
更新添加更多信息:
- 来自远程主机https://pastebin.com/nn13rU0J的Java调试
- 来自本地主机https://pastebin.com/gRBZaKET的Java调试
通过 IDE (IntellJ) 登录并激活选项 (-Didea.debugger.trace=ALL) https://pastebin.com/mRtYDf2d
在 Digital Ocean VM 的防火墙设置上
【问题讨论】:
-
您可以查看Java debugger logs 以尝试了解更多详细信息为什么卡住了。
-
还可以使用jstack 获取线程转储,以查看应用程序在您的服务器上执行的操作以及为什么它没有响应。线程转储可能有助于识别问题。
-
-
您可以通过 pastebin 共享调试器日志和 jstack 输出,以便其他人可以查看。
-
@CrazyCoder 我已经尽可能地更新了最完整的信息
标签: java intellij-idea remote-debugging