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!
More Posts related to Java,
- CRUD operations in Spring Boot + JDBC
- Java Check Leap Year - Programs with Code Examples
- [fix] Java JDBC ConnectException: Connection refused
- How to add hours and minutes to Java Instant
- Java Program: Random Number Generator
- Java: The value of the local variable string is not used
- How to get list of all Java versions installed on macOS
- Java SE JDBC with Prepared Statement Parameterized Select Example
- Java + Spring JDBC Template + Gradle Example
- Convert String to LocalDate in Java
- Remove Trailing zeros BigDecimal Java
- Java 8 Predicate Functional Interface isEqual() Method Example
- How to Hardcode Date in Java with Examples
- Java 8: Predicate negate() default Function Example
- Java: Collect Stream as ArrayList or LinkedList
- The Motivation Behind Generics in Java Programming
- How to Add/Subtract Days to the Current Date in Java
- Error: Can not find the tag library descriptor for
- Setting up JUnit 5 dependency with Maven Example
- Run Java Code Every Second
- How to create a tar.gz file using Java
- [Fix] java: integer number too large compilation error
- Java 8: Find the Max value in a List
- Your JBoss Application Server 7 is running However you have not yet added any users to be able to access the admin console
- Convert Java Array to ArrayList Code Example
More Posts:
- Program 15: Find String is a Palindrome or Not - 1000+ Python Programs - Python-Programs
- How to Install CVS Version Control on Linux/Ubuntu - Linux
- Convert seconds to minutes using JavaScript - JavaScript
- How to know the Version of Notepad App on Windows 11 - Windows-11
- Comprehensive 256 Ascii code table with Html Hex IBM Microsoft Key - Html
- [Solved] SharePoint Search Internal server error exception - SharePoint
- How To Remove Only Conditional Formatting in Excel - Microsoft
- How to reset AirPods or AirPods Pro using iPhone/iPad or iPod - iOS