Bích Mai Vũ
Bích Mai Vũ

Reputation: 3

cannot start Tomcat 9 - java.net.BindException: Address already in use

Hi i am not able to start tomcat 7 server from eclipse.

When i give start from eclipse i get the following error log.


26-Nov-2022 14:58:14.226 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
26-Nov-2022 14:58:14.240 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-8080]]
    org.apache.catalina.LifecycleException: Protocol handler initialization failed
        at org.apache.catalina.connector.Connector.initInternal(Connector.java:1050)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
        at org.apache.catalina.core.StandardService.initInternal(StandardService.java:554)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
        at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1045)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:724)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
        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.apache.catalina.startup.Bootstrap.load(Bootstrap.java:305)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
    Caused by: java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:438)
        at sun.nio.ch.Net.bind(Net.java:430)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225)
        at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:275)
        at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:230)
        at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1227)
        at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1240)
        at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:604)
        at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:76)
        at org.apache.catalina.connector.Connector.initInternal(Connector.java:1047)
        ... 13 more
26-Nov-2022 14:58:14.242 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1830] milliseconds
26-Nov-2022 14:58:14.318 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
26-Nov-2022 14:58:14.319 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.69]
26-Nov-2022 14:58:14.357 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [C:\Users\Admin\.SmartTomcat\MyNTT11_JWD.L.A101\MyNTT11_JWD.L.A101\conf\Catalina\localhost\A101.xml]
26-Nov-2022 14:58:15.685 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars 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.
26-Nov-2022 14:58:15.961 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [C:\Users\Admin\.SmartTomcat\MyNTT11_JWD.L.A101\MyNTT11_JWD.L.A101\conf\Catalina\localhost\A101.xml] has finished in [1,602] ms
26-Nov-2022 14:58:15.966 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [1723] milliseconds
http://localhost:8080/A101

Now what I should do to solve it. Thank you

Upvotes: 0

Views: 1733

Answers (1)

Tharaka Sandaruwan
Tharaka Sandaruwan

Reputation: 111

Cause

The port Bamboo is attempting to use is already in use. This can be caused either by another application running on the port or failed shutdown of Bamboo that has left the port open.

Solution

On Windows

  1. Hit Ctrl-alt-delete and look at open programs. Look for java.exe.
  2. From a command window, run netstat -an. Check which ports are in use. You can identify which application is running this way, then close it from the Task Manager.

On Linux

Run: ps -aux | grep java. This will show the java processes running and their process ids. You can kill a process with the command: kill -9 <pid>

Source

Upvotes: 2

Related Questions