When opening the connection from the client you shouldn't place
localhost inside your url. Placing the word
localhost inside the url makes the open() method open a server connection. For more details check com.intel.bluetooth.MicroeditionConnector.openImpl() method on line 205. you will see this cone
isServer = host.equals("localhost");
For the client try btl2cap://0050CD00321B:1001;ReceiveMTU=512;TransmitMTU=512 as a url. modify it according to your needs.