If you are trying to run your XML-RPC-based web server and you get the following error,
XML-RPC Server Started!
JavaXmlRpcServer: java.net.BindException: Address already in use error.
This means that you have already some service running on this port that you have used to deploy your web service, to resolve this issue either you have to stop the service that's running (for example apache or IIS server running on port 80 or tomcat server if you have specified port as 8080).
BindException states that you are attempting to bind a socket to a port and the port is in use, or the requested local address could not be assigned.
How to kill the service on Unix/Linux-based environment:
- Open Terminal
- Run the command with the port used: example: lsof -i :1081
- You will get an output with ProcessID - PID if some process is running on it.
- Now kill the process by running the following command: kill -9 <PID> (example: kill -9 4723)
- Now try to run the server you would not get BindException exception
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 4723 code2care 22u IPv6 0x30asf0sdsdf 0t0 TCP *:pvusdfien (LISTEN)
Have Questions? Post them here!
- Add two numbers using Java Generics
- Convert Java List to Json String using Jackson
- Convert Java Object to JSON using Jackson Library
- Java SE JDBC: Insert with PreparedStatement Example
- [Program] How to read three different values using Scanner in Java
- Java JDBC Batch Update Example with PreparedStatement
- Java Stream flatmap() Examples
- Save Java Object as JSON file using Jackson Library
- Java get day of the week as an int using DayOfWeek
- Create Nested Directories using Java Code
- Java JDBC Delete a Record in Database Table using PreparedStatement
- List of jars required for Struts2 project
- Convert Java Object to XML using Jackson Library
- Struts2 : java.lang.ClassNotFoundException: org.apache.commons.fileupload.RequestContext
- Java JDBC Get Id of the Inserted Record with AutoIncrement
- How to list all tables using Java JDBC
- Java Jackson ObjectMapper Class with Examples
- Fix: Maven - Failed to execute goal - Compilation failure - Source/Target option 5 is no longer supported. Use 7 or later
- Eclipse : The type java.lang.CharSequence cannot be resolved. Indirectly referenced from required .class files
- Formatting Double in Java [Examples]
- How to run Java Unit Test cases with Apache Maven?
- [fix] NullPointerException Cannot Invoke findById because Repository is null - Java Spring
- [Fix] java: integer number too large compilation error
- [Java] Read a File with UTF-8 Encoding
- How to detect Operating System using Java code
- Convert JSON to Gson with type as ArrayList - Java
- How to write JSON file in Python Program - Python
- Permanently Set or Change $JAVA_HOME on Mac (macOS) - MacOS
- How to redirect SharePoint Site Collection to different URL - SharePoint
- How to know list of images available on your device - Docker
- Fix: Ubuntu (Linux) - bash: sudo: command not found error - Ubuntu
- How to take screenshot on Android - Android
- Android Parsing Data for android-L failed Unsupported major.minor version 51.0 Error - Android