java.net.BindException: Cannot assign requested address at java.net.PlainSocketImpl. socketBind(Native Method).

‘Exception: java.net.Bind’ error. This error message indicates that the port your server is trying to bind to is already occupied, preventing your server from starting or operating properly.

You will see below exception while starting tomcat server.

java.net.BindException
java.net.BindException
Exception:
java.net.BindException: Cannot assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.ServerSocket.bind(ServerSocket.java:375)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
Resolving the ‘Exception: java.net.Bind’

Step 1. Move to conf directory using command prompt or linux terminal
          apache-tomcat $ cd conf and

Step 2. Open server.xml file which is available in confg folder
        apache-tomcat/conf $ vi server.xml

Step 3. add address=”0.0.0.0″ to <Server port=”7005″ shutdown=”SHUTDOWN”>
<Server port=”7005″ address=”0.0.0.0″ shutdown=”SHUTDOWN”>

Step 4. Restart the service

How to Safely Kill Running Ports?

Command to start / stop tomcat

 

One Reply to “How to Solve the ‘java.net.BindException’ and Get Your Server up and Running in 4 Step”

Leave a Reply

Your email address will not be published. Required fields are marked *