Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

LocalDevice.initialize() throws exception

  • When I run the code mentioned at the last following errors are received

    Exception in thread "main" Address already in use (Bind failed)
    at java.base/ Method)
    at java.base/
    at java.base/
    at java.base/<init>(
    at com.serotonin.bacnet4j.npdu.ip.IpNetwork.initialize(
    at com.serotonin.bacnet4j.transport.DefaultTransport.initialize(
    at com.serotonin.bacnet4j.LocalDevice.initialize(

    The code is:
    public class App
    public static void main( String[] args ) throws Exception
    final int port = 47808;
    IpNetwork network;
    network = new IpNetworkBuilder()
    .withSubnet("", 24)
    Transport transport = new DefaultTransport(network);
    LocalDevice localDevice = new LocalDevice(1000, transport);
    try {
    } catch (Exception e) {
    // TODO Auto-generated catch block

    The same exception is also received for localDevice.initialize(RestartReason.coldstart);

    Please provide solution.


  • Hi Kishore,

    The "address already in use" exception means some other application has already bound the port. Perhaps you have another BACnet application running on this computer? Perhaps your application is already running?

  • Hello,

    There is no other application running. When I terminate the server no response this local Device. But every time at the inititalize() command, I am getting exception.

    Further the values of device object, services that are modified and objects that are added not reflected in the local device. That is from the 3rd party client if I send the ReadProperty request, only the default values are returned and not the values that are set in the code. Probably I will raise another ticket with the code which help us to solve two different issues.


  • Well, the exception means that something else has already bound the port, so you could figure out what has the port with some netstat commands probably. Or you could restart your machine to clear whatever it is (unless it starts at startup).

    If you have a third party application able to read from the port, and you cannot run the code now, wouldn't that suggest some application is running on the port already?

  • Yes, you are right. somehow port is blocked. After killing the process and the running the app, initialize() command was executed successfully.