Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Resolving Exceptions: ''java.net.BindException: Address Already in Use''

DZone's Guide to

Resolving Exceptions: ''java.net.BindException: Address Already in Use''

The reason behind the error is that some other application is already running with the same port. You cannot run the current application with the same port.

Free Resource

Discover how Microservices are a type of software architecture where large applications are made up of small, self-contained units working together through APIs that are not dependent on a specific language. Brought to you in partnership with AppDynamics.

When you run the Mule application in Anypoint Studio or deploy Mule application in Mule Runtime, it is common to get the following error:

ERROR 2016-09-0522:17:57,070 [main] org.mule.module.launcher.application.DefaultMuleApplication: 

********************************************************************************

Message               : Failed to invoke lifecycle phase "start" on object: org.mule.module.http.internal.listener.DefaultHttpListenerConfig@7c1503a3

Element               : /HTTP_Listener_Configuration @ app:bindingerrortesting.xml:9 (HTTP Listener Configuration)

--------------------------------------------------------------------------------

Root Exception stack trace:

java.net.BindException: Address already in use

at sun.nio.ch.Net.bind0(Native Method)

at sun.nio.ch.Net.bind(Net.java:433)

at sun.nio.ch.Net.bind(Net.java:425)

at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)

The reason behind the error is that some other application is already running with the same port. You cannot run the current application with the same port.

If you are using Windows OS, then go to the command prompt and run the following command:

netstat -a -n -p tcp -b

This will list all services running, protocols used, and other details.

If needed, stop the other application that is running on the same port. If possible, change your application’s port number. If multiple Mule applications need to run on the same host and port, then use Domain Project and create listener and request configurations in the domain project and let your apps support the domain project. This will fix the binding clashes.

Hope this helps!

Discover the six challenges and best practices in managing microservice performance, brought to you in partnership with AppDynamics.

Topics:
exceptions ,mule esb ,integration

Published at DZone with permission of Akkiraju Ivaturi. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}