3

I have a spring boot application which I have started for debug using command:

sudo mvnDebug spring-boot:run

The Spring app shows message:

Preparing to execute Maven in debug mode
Listening for transport dt_socket at address: 8000

Now, I start the debugging from eclipse attaching to listener at locahost:8000.

The Spring Boot application shows error now as below:

    17:26:20.747 initApplicationContext: this=com.xxx.platform.sp.spring.SpringApplicationContext@63c29d69 prev=null applicationContext=org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@738f69dd: startup date [Tue Oct 31 17:25:55 IST 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@76a02fc2  (cl=java.net.URLClassLoader@45bb3370)
[WARNING] 
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat servlet container
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:165)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
    at com.intuit.cfp.sp.service.taximport.WebApplication.main(WebApplication.java:22)
    ... 6 more
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:159)
    ... 16 more

I am unable to debug. Any help is appreciated.

Rajive Pai
  • 312
  • 1
  • 13
  • hi Rajeev there are two ways you can debug spring boot app either through command prompt or through eclipse configurations.If you are using eclipse you can use DebugConfigurations->RemoteJavaApplication->Configure the port with locahost name and provide the port and debug if you are using command prompt it is different scenario. – Pradeep Oct 31 '17 at 13:21
  • https://stackoverflow.com/questions/36217949/maven-spring-boot-run-debug-with-arguments for command-prompt debugging – Pradeep Oct 31 '17 at 13:22
  • In the full stack is there a `port already in use error`? – user10089632 Nov 11 '17 at 00:53
  • Yes, infact that was the issue, port was in use! – Rajive Pai Nov 23 '17 at 18:53

0 Answers0