0

I have a problem starting my first Java Spring application, when simply trying to run my project, im given the following error:

Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version name:   Apache Tomcat/9.0.34
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Apr 3 2020 12:02:52 UTC
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 9.0.34.0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 7
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            6.1
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Program Files\Java\jre1.8.0_231
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_231-b11
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\Users\hds\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 9.0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\hds\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\hds\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 9.0\endorsed
Apr 19, 2020 9:41:31 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1250
Apr 19, 2020 9:41:31 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.7.0].
Apr 19, 2020 9:41:31 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Apr 19, 2020 9:41:31 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
Apr 19, 2020 9:41:31 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized [OpenSSL 1.1.1c  28 May 2019]
Apr 19, 2020 9:41:33 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Apr 19, 2020 9:41:33 PM org.apache.catalina.startup.Catalina load
INFO: Server initialization in [1,749] milliseconds
Apr 19, 2020 9:41:33 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Apr 19, 2020 9:41:33 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet engine: [Apache Tomcat/9.0.34]
Apr 19, 2020 9:41:34 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Apr 19, 2020 9:41:35 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'dispatcher'
Apr 19, 2020 9:41:35 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: Initializing Servlet 'dispatcher'
Apr 19, 2020 9:41:37 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: Completed initialization in 2213 ms
Apr 19, 2020 9:41:37 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Apr 19, 2020 9:41:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in [4,096] milliseconds
Apr 19, 2020 9:41:37 PM org.apache.catalina.core.StandardServer await
SEVERE: Failed to create server shutdown socket on address [localhost] and port [8080] (base port [8080] and offset [0])
java.net.BindException: Address already in use: JVM_Bind
    at java.net.DualStackPlainSocketImpl.bind0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
    at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:584)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:721)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:667)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:343)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:474)

Apr 19, 2020 9:41:37 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-nio-8080"]
Apr 19, 2020 9:41:37 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service [Catalina]
Apr 19, 2020 9:41:37 PM org.apache.catalina.core.ApplicationContext log
INFO: Destroying Spring FrameworkServlet 'dispatcher'
Apr 19, 2020 9:41:37 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-nio-8080"]
Apr 19, 2020 9:41:37 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-nio-8080"]

I have no processes using port 8080 either 8090 (killed them in cmd) and the shutdown port in server.xml is defined as 8090, while startup is defined as 8080 so it all should work, but it seem not to somehow. Does anyone know a solution to this?

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
JD_KX
  • 3
  • 4
  • Welcome to SO JD_KX. While you are getting this error, share the output of these commands from your machine as per your Operating system - Linux/Windows/Mac: netstat -tulpn | grep :8080 / netstat -aon | findstr 8080 / lsof -n -i4TCP:8080. Its not possible that you killed the port process and still getting the error. – Ajay Kumar Apr 19 '20 at 20:14
  • check out this tool (TCPView) as mention here https://stackoverflow.com/questions/12737293/how-do-i-resolve-the-java-net-bindexception-address-already-in-use-jvm-bind – Tarek Badr Apr 19 '20 at 20:41
  • @AjayKumar do u mean output from my cmd? if so then netstat -aon | findstr 8080 (im on windows) gives me no output, im sure i have killed it but it still seem not working. :/ – JD_KX Apr 19 '20 at 21:09
  • SEVERE: Failed to create server shutdown socket on address [localhost] and port [`8080`] (base port [8080] and offset [0]) java.net.BindException: `Address already in use`: JVM_Bind – caot Apr 19 '20 at 22:54
  • Assuming you are using some IDE (eclipse etc). Does restarting IDE resolves your issue? – Ajay Kumar Apr 19 '20 at 22:55
  • @Ajay Kumar, no, i ve tried anything i have found on the Internet including basic thing as restarting eclipse, killing javaw in processes etc. And it didn't help so I had to make this question here because I really want to fix this ASAP and learn. – JD_KX Apr 20 '20 at 08:38
  • @caot I know right, If it was so easy to fix I would do it myself not post here, the problem is nothing uses my 8080 port, I've even checked it using the TCPView program someone mentioned before, and no, 8080 is not used in any way. I'm guessing maybe it's being used by the tomcat upon server startup by something else therefore it's already busy when creating shutdown? Really no idea. – JD_KX Apr 20 '20 at 08:44
  • @JD_KX It might be helpful or the same issue at https://stackoverflow.com/questions/12737293/how-do-i-resolve-the-java-net-bindexception-address-already-in-use-jvm-bind – caot Apr 20 '20 at 11:14
  • @caot The thing is everyone assume that a fix to this is just killing a process, while in my case that does not fix the problem. – JD_KX Apr 20 '20 at 14:20
  • Now I am pulling my hair.! Okay...Do you have anything like, Jenkins/Apache-httpd etc configured/installed on you machine (on port# 8080). Can you check your services and see what all you have running there? – Ajay Kumar Apr 21 '20 at 04:01

0 Answers0