2

I am using Spring Tool Suite. I check out demo projects in STS. It works fine without any problem before I installed updates in STS today or I installed Oracle SQL Developer recently.

The steps to reproduce my bug:

In STS, in "File" -> "New" -> "Import Spring Getting Started Content", then check out "Building a RESTful Web Service" this project. https://spring.io/guides/gs/rest-service/ I go to my project folder, type 'mvnw spring-root:run' (I am using Windows). Then got following error.

I do not if this bug related to I installed two updated in STS today or I installed Oracle SQL Developer recently.

Here is the error:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.6.RELEASE:run (default-cli) on project gs-rest-service: An exception occurred while running. null: InvocationTargetException: Connector configured to listen on port 8080 failed to start -> [Help 1]

enter image description here

Then, I checked out the solution in here: https://stackoverflow.com/a/27416379/8229192

It works after I kill the task which uses the port 8080.

c:\>netstat -ano | find "8080"
 TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       3088
 TCP    [::]:8080              [::]:0                 LISTENING       3088
 c:\>taskkill /F /PID 3088
 SUCCESS: The process with PID 1196 has been terminated.

My questions are:

  1. Why will I have port conflict? Because I installed Oracle SQL Developer? How can I know exactly which software is using port 8080 also?

  2. I want to know if I kill the task (A) which uses that port 8080, will it cause an issue when this task (A) run later?

  3. I have checked out other projects (like: https://spring.io/guides/gs/scheduling-tasks/). I did not need to kill the task which is also using port 8080, I just directly run "mvnw spring-boot:run". It works and it does not have port number 8080 conflict. Why? Why some have port 8080 conflict, why some are not? This is very confused me. Thanks.

FullStackDeveloper
  • 814
  • 12
  • 33

1 Answers1

1
  1. Oracle-XE, OracleXETNSListener service, uses port 8080 to serve its Application Express.
  2. You kill OracleXETNSListener service, it has no problem at all because you use SQL Developer not Application Express. Or you can disable its auto start configuration.
  3. Spring Boot's project, serves web server, uses port 8080 by default, you can run with different port Spring Boot - how to configure port, and https://spring.io/guides/gs/scheduling-tasks is not web serving project so it doesn't use any port.

hope this can help you

raksa
  • 770
  • 5
  • 15
  • (1 )If I kill the task that run port 8080, after I restart the computer, will this task use port 8080 again? (2) "Or you can disable its auto start configuration" How to do it? – FullStackDeveloper Aug 08 '17 at 02:54
  • after restart machine service will get running again if it is configured to be auto start, this guide, https://www.sevenforums.com/tutorials/2495-services-start-disable.html, will show you how to disable a service – raksa Aug 08 '17 at 03:03
  • "Oracle-XE, OracleXETNSListener service, uses port 8080" How do you know it use port 8080? I check the Service, and did not find its port number – FullStackDeveloper Aug 08 '17 at 03:12
  • as you can see, in your case above by **netstat**, **PID: 3088** using port 8080, then you will see **OracleXETNSListener** service is running with **PID: 3088** when you open service tool – raksa Aug 08 '17 at 03:18
  • I restart my computer, and get this error: "2017-08-07 22:40:29.356 INFO 11524 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@d825212: startup date [Mon Aug 07 22:40:28 CDT 2017]; root of context hierarchy 2017-08-07 22:40:29.356 INFO 11524 --- [ Thread-2] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown" – FullStackDeveloper Aug 08 '17 at 03:41
  • Look like after I kill the task which uses port 8080, now port 8080 cannot work? – FullStackDeveloper Aug 08 '17 at 03:42
  • let use another port if you still doubt, or maybe it is different kind of error. – raksa Aug 08 '17 at 03:47