bluecove-gpl ServiceRegistrationException (2.1.0 and 2.1.1)

1,032 views
Skip to first unread message

John Connolly

unread,
Oct 6, 2010, 1:26:37 PM10/6/10
to bluecove-...@googlegroups.com, Vish Kumar
Hello,

I'm using bluecove-gpl from here: http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.62/bluecove-gpl-2.1.1-SNAPSHOT-sources.tar.gz
And the rest of the bluecove stack from here: http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.62/bluecove-2.1.1-SNAPSHOT-sources.tar.gz

My sample app tries to register a service with the following code:


if (SERVER_MODE) {
            new Thread() {
                String url = "btspp://localhost:" + new UUID(0x1101).toString()
                        + ";name=SampleServer";

                public void run() {
                    try {
                        // create a server connection
                        StreamConnectionNotifier notifier = (StreamConnectionNotifier) Connector
                                .open(url);
                        // accept client connections
                        StreamConnection connection = notifier.acceptAndOpen();
                        // prepare to send/receive data
                        byte buffer[] = new byte[100];
                        String msg = "hello there, client";
                        InputStream is = connection.openInputStream();
                        OutputStream os = connection.openOutputStream();
                        // send data to the client
                        os.write(msg.getBytes());
                        // read data from client
                        is.read(buffer);
                        connection.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }.start();
        }

When executed, I get the following stacktrace:

javax.bluetooth.ServiceRegistrationException: Can not open SDP session. [2] No such file or directory
        at com.intel.bluetooth.BluetoothStackBlueZ.openSDPSessionImpl(Native Method)
        at com.intel.bluetooth.BluetoothStackBlueZ.getSDPSession(BluetoothStackBlueZ.java:518)
        at com.intel.bluetooth.BluetoothStackBlueZ.registerSDPRecord(BluetoothStackBlueZ.java:543)
        at com.intel.bluetooth.BluetoothStackBlueZ.rfServerOpen(BluetoothStackBlueZ.java:607)
        at com.intel.bluetooth.BluetoothRFCommConnectionNotifier.<init>(BluetoothRFCommConnectionNotifier.java:42)
        at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:377)
        at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:162)
        at javax.microedition.io.Connector.open(Connector.java:83)
        at com.buglabs.bug.jni.bluetooth.tests.Activator$1.run(Activator.java:99)

So it looks like this is failing:
  sdp_session_t* session = sdp_connect(BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY);
    if (!session) {
        throwServiceRegistrationException(env, "Can not open SDP session. [%d] %s", errno, strerror(errno));
        return 0;
    }
    return ptr2jlong(session);

Any ideas?  This is running against bluez4.35

Thanks.

-John

Mina Shokry

unread,
Oct 6, 2010, 1:33:41 PM10/6/10
to bluecove-...@googlegroups.com
try changing the UUID of the service. I expect this problem may be because a service with the same UUID is already running on your system. try using a custom UUID.

--
You received this message because you are subscribed to the Google
Groups "bluecove-developers" group.
For more options, visit this group at
http://groups.google.com/group/bluecove-developers

John Connolly

unread,
Oct 6, 2010, 2:04:33 PM10/6/10
to bluecove-...@googlegroups.com, Vish Kumar
[...]

On Wed, Oct 6, 2010 at 1:33 PM, Mina Shokry <minas...@gmail.com> wrote:
try changing the UUID of the service. I expect this problem may be because a service with the same UUID is already running on your system. try using a custom UUID.


Tried changing the UUID, but still the same problem:

String url = "btspp://localhost:" +  new UUID("57e33d1fc1674f5aa94f5f0c58f49356", false).toString()
                        + ";name=SampleServer";

btspp://localhost:57e33d1fc1674f5aa94f5f0c58f49356;name=SampleServer

javax.bluetooth.ServiceRegistrationException: Can not open SDP session. [2] No such file or directory
        at com.intel.bluetooth.BluetoothStackBlueZ.openSDPSessionImpl(Native Method)
        at com.intel.bluetooth.BluetoothStackBlueZ.getSDPSession(BluetoothStackBlueZ.java:518)
        at com.intel.bluetooth.BluetoothStackBlueZ.registerSDPRecord(BluetoothStackBlueZ.java:543)
        at com.intel.bluetooth.BluetoothStackBlueZ.rfServerOpen(BluetoothStackBlueZ.java:607)
        at com.intel.bluetooth.BluetoothRFCommConnectionNotifier.<init>(BluetoothRFCommConnectionNotifier.java:42)
        at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:377)
        at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:162)
        at javax.microedition.io.Connector.open(Connector.java:83)
        at com.buglabs.bug.jni.bluetooth.tests.Activator$1.run(Activator.java:101)

Are there jni-level debug messages I could enable to shed more light?

-John

John Connolly

unread,
Oct 6, 2010, 5:06:54 PM10/6/10
to bluecove-...@googlegroups.com, Vish Kumar
On Wed, Oct 6, 2010 at 2:04 PM, John Connolly <jeco...@gmail.com> wrote:
[...]

On Wed, Oct 6, 2010 at 1:33 PM, Mina Shokry <minas...@gmail.com> wrote:
try changing the UUID of the service. I expect this problem may be because a service with the same UUID is already running on your system. try using a custom UUID.


Tried changing the UUID, but still the same problem:

String url = "btspp://localhost:" +  new UUID("57e33d1fc1674f5aa94f5f0c58f49356", false).toString()
                        + ";name=SampleServer";

btspp://localhost:57e33d1fc1674f5aa94f5f0c58f49356;name=SampleServer

javax.bluetooth.ServiceRegistrationException: Can not open SDP session. [2] No such file or directory
        at com.intel.bluetooth.BluetoothStackBlueZ.openSDPSessionImpl(Native Method)
        at com.intel.bluetooth.BluetoothStackBlueZ.getSDPSession(BluetoothStackBlueZ.java:518)
        at com.intel.bluetooth.BluetoothStackBlueZ.registerSDPRecord(BluetoothStackBlueZ.java:543)
        at com.intel.bluetooth.BluetoothStackBlueZ.rfServerOpen(BluetoothStackBlueZ.java:607)
        at com.intel.bluetooth.BluetoothRFCommConnectionNotifier.<init>(BluetoothRFCommConnectionNotifier.java:42)
        at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:377)
        at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:162)
        at javax.microedition.io.Connector.open(Connector.java:83)
        at com.buglabs.bug.jni.bluetooth.tests.Activator$1.run(Activator.java:101)

Are there jni-level debug messages I could enable to shed more light?

It appears that the problem stems from not having bluetoothd running.  Thanks.
 

Martin Burtscher

unread,
Feb 18, 2015, 8:00:40 AM2/18/15
to bluecove-...@googlegroups.com, vishal...@buglabs.net
Reply all
Reply to author
Forward
0 new messages