title: BlueCove with Bluez chucks "Can not open SDP session. [2] No such file or directory"
body: <p>I am trying to write a simple Bluetooth server that accepts an connection from my HeartRate-Device (bluetooth LE) but it always raises an exception</p>
  <pre><code>javax.bluetooth.ServiceRegistrationException: Can not open SDP session. [2] No such file or directory
  at com.intel.bluetooth.BluetoothStackBlueZ.openSDPSessionImpl(Native Method) ~[bluecove-gpl-2.1.1-SNAPSHOT-63.jar:2.1.1-SNAPSHOT]
  at com.intel.bluetooth.BluetoothStackBlueZ.getSDPSession(BluetoothStackBlueZ.java:518) ~[bluecove-gpl-2.1.1-SNAPSHOT-63.jar:2.1.1-SNAPSHOT]
  at com.intel.bluetooth.BluetoothStackBlueZ.registerSDPRecord(BluetoothStackBlueZ.java:543) ~[bluecove-gpl-2.1.1-SNAPSHOT-63.jar:2.1.1-SNAPSHOT]
  at com.intel.bluetooth.BluetoothStackBlueZ.rfServerOpen(BluetoothStackBlueZ.java:607) ~[bluecove-gpl-2.1.1-SNAPSHOT-63.jar:2.1.1-SNAPSHOT]
  at com.intel.bluetooth.BluetoothRFCommConnectionNotifier.&lt;init&gt;(BluetoothRFCommConnectionNotifier.java:42) ~[bluecove-2.1.1-SNAPSHOT-63.jar:2.1.1-SNAPSHOT]
  at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:389) ~[bluecove-2.1.1-SNAPSHOT-63.jar:2.1.1-SNAPSHOT]
  at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:156) ~[bluecove-2.1.1-SNAPSHOT-63.jar:2.1.1-SNAPSHOT]
  at javax.microedition.io.Connector.open(Connector.java:83) ~[bluecove-2.1.1-SNAPSHOT-63.jar:2.1.1-SNAPSHOT]
  at com.mmazurcz.bluetoothserver.WaitThread.waitForConnection(WaitThread.java:39) [classes/:na]
  at com.mmazurcz.bluetoothserver.WaitThread.run(WaitThread.java:60) [classes/:na]
  at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
  </code></pre>
  <p>I am running my code on an Arch Linux machine with kernel &quot;4.0.5-1-ARCH #1 SMP PREEMPT&quot;.</p>
  <p>Java is OpenJDK at version 1.8.0_45 and Bluecove is at version 2.1.1-SNAPSHOT-63. I've got the following BlueZ artifacts installed:</p>
  <ol>
  <li>bluez 5.30-1</li>
  <li>bluez-firmware 1.2-8</li>
  <li>bluez-libs 5.30-1</li>
  <li>bluez-utils 5.30-1</li>
  </ol>
  <p>The Bluetooth dongle I am using is up and running and I can scan for my heart-rate device using <code>hcitool -i hci0 lescan</code>. I am also running my code as the root user.</p>
  <p>So, here is the piece of code that brings me trouble:</p>
  <pre><code>StreamConnectionNotifier notifier;
  StreamConnection connection = null;
  
  // setup the server to listen for connection
  try {
      local = LocalDevice.getLocalDevice();
      log.info(&quot;Set up local device with BT address: &quot; + local.getBluetoothAddress());
      local.setDiscoverable(DiscoveryAgent.GIAC);
      log.info(&quot;Set local device to GIAC discovery mode&quot;);
  
      UUID uuid = new UUID(&quot;1101&quot;, true);
      String url = &quot;btspp://localhost:&quot; + uuid.toString() + &quot;;name=RemoteBluetooth&quot;;
      notifier = (StreamConnectionNotifier) Connector.open(url);
  } catch (Exception e) {
      log.error(&quot;Exception in WaitThread.waitForConnection&quot;, e);
      return;
  }
  </code></pre>
  <p>Any ideas?</p>