Felipe Inostroza
Felipe Inostroza

Reputation: 21

Remote Debug with IntelliJ

i need help with the options for remote debug on intell J IDE, i have successfully connection with my remote host provided by Digital Oceans VM, but i cant start debugging from my IDE.

Here is an image that shows the correct connection on local machine (Ubuntu 18.04):

img

previously i set the VM execution of my Spring Boot on remote host (Ubuntu 18.04):

.../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)

Then i send the request from my Postman to the endpoint for start debugging but nothing happens with the app on remote server neither in my IDE. I test without the VM arguments for transport to verify the call from postman and the app responds, but when i put those arguments postman cant arrived with his request.

Important things to know:

enter image description here

enter image description here

UPDATE ADDING MORE INFORMATION:

Upvotes: 1

Views: 2018

Answers (1)

Felipe Inostroza
Felipe Inostroza

Reputation: 21

I Solved the issue with adding more RULES to my VM on Network Section:

  1. HTTP (80) for listen from HTTP request from SOAP UI
  2. ICMP for ping stuff
  3. Custom Open port (7171 in my case) because spring boot controllers are configured on those ports, but i don't think that is very useful because with 80 port open is enough.
  4. Custom Open port (5005 in my case) for connection between IntellJ and remote host.
  5. In my IDE (intellJ) on right-side section on Maven slap, i mark clean & install options because i need to be sure that is the same code version that i have on my local and remote host, then from my local target folder i took my .jar and put on the remote host, then i ran that .jar with the commands and those arguments and yea! when i send the request to the remote host on my local IDE arrived and the break point was activated.

thanks to the community, see you!

Upvotes: 1

Related Questions