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)
Facing issues? Have Questions? Post them here! I am happy to answer!
- Java equals method - Tutorial
- Unbound classpath container: JRE System Library [JavaSE-1.7]
- Spring Boot: @RequestBody not applicable to method
- Java 8: Steam map with Code Examples
- Java Program: Random Number Generator
- Java java.time.Clock class code examples [Java Date Time API]
- Fix: type argument is not within bounds of type-variable T
- [Fix] java.net.MalformedURLException: unknown protocol
- Java 7 addSuppression() and getSuppression() Exception Handling
- Convert Java Array to ArrayList Code Example
- How to Word-Warp Console logs in IntelliJ
- Ways Compare Dates in Java Programming with Examples
- Remove Trailing zeros BigDecimal Java
- CRUD operations in Spring Boot + JDBC
- [Java Threads] Should we extend Thread Class or implement Runnable interface
- Json Serialization and Deserialization using Java Jackson
- Create simple struts2 project using maven commands
- How to install Java OpenJDK 11 on Alpine Linux
- Unsupported major.minor version 52.0 in java
- Error: Can not find the tag library descriptor for
- Java: Convert String to Binary
- How to run Java Unit Test cases with Apache Maven?
- Java: Testing Private Methods in JUnit using reflection API Example
- Java JDBC Connection with MySQL Driver in VS Code + Troubleshooting
- Java Join Strings with Comma Separator
- How to enable Do Not Disturb mode for Notification Center in Mac OS X 10.10 Yosemite - Mac-OS-X
- Shortcut: Move Cursor at the start or end of Line or file in Visual Studio Code (VS Code) - Shortcuts
- [Gmail] Calling in Hangouts will be turned off soon. - News
- How to reset AirPods or AirPods Pro using iPhone/iPad or iPod - iOS
- Add Line Break in Microsoft Excel Cell on Mac (macOS) - MacOS
- Sort a List using Java 8 Stream Examples - Java
- Right Align Text in Bootstrap framework - Bootstrap
- Turn off Startup Sound on Mac running on macOS Ventura - MacOS