Bluetooth server

Help
Natsuki
2011-06-08
2013-04-26
  • Natsuki
    Natsuki
    2011-06-08

    Would someone kindly tell me if it possible-and if so how-to run the bluetooth server on a PC? I mean, that's the whole point-to be able to send the log to the PC and transfer it to the developer, right?

     
  • Natsuki
    Natsuki
    2011-06-09

    While those articles are nice, they haven't helped me (I have read them).
    The first one, I assume, uses an oudated version. I use the server from the microlog package. Here is what I get:

    java -cp microlog-server-bluetooth-2.3.5.jar net.sf.microlog.server.btspp.MicrologBtsppServer
    Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/microlog/server/btspp/MicrologBtsppServer
    Caused by: java.lang.ClassNotFoundException: net.sf.microlog.server.btspp.MicrologBtsppServer
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: net.sf.microlog.server.btspp.MicrologBtsppServer.
      Program will exit.

    Peeking inside the package, I find net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI. But this fails to work, as well:

    java -cp microlog-server-bluetooth-2.3.5.jar net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI
    net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUIException in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/microedition/io/Connection
            at net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI.<init>(Mic
    rologBluetoothServerUI.java:78)
            at net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI$1.run(Micr
    ologBluetoothServerUI.java:61)
            at java.awt.event.InvocationEvent.dispatch(Unknown Source)
            at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
            at java.awt.EventQueue.access$000(Unknown Source)
            at java.awt.EventQueue$1.run(Unknown Source)
            at java.awt.EventQueue$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
    Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: javax.microedition.io.Connection
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            … 16 more

     
  • Johan Karlsson
    Johan Karlsson
    2011-06-09

    If you look closely into the stack trace you find that there is a system class missing:

    ava.lang.NoClassDefFoundError:
    javax/microedition/io/Connection

    Thus this is not a problem within the Microlog package. You must ensure that you have downloaded and installed the Bluecove package, as mentioned in my first answer. The Bluecove package must of course be included on the classpath one way or another.

     
  • Natsuki
    Natsuki
    2011-06-09

    Thanks for that. The readme doesn't exactly say this kind of stuff.
    (It should probably be fixed.)
    But I suck at setting classpaths…

    set CLASSPATH=C:\Temp\bluecove-2.1.0.jar
    java -cp microlog-server-bluetooth-2.3.5.jar net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI

    Same error. And bluecove does exist, the filename is correct. That much I verified.
    Putting the file in the same directory as the server doesn't work, either.
    Now I'm confused. The package does contain the javax.microedition.io package (and Connection class), yet it still fails to find it!

     
  • Natsuki
    Natsuki
    2011-06-09

    YES! Thanks for Wikipedia! I knew there was a folder to drop files in to make Java automatically load them.

     
  • Johan Karlsson
    Johan Karlsson
    2011-06-09

    I am glad that you got it to work! :)

    Happy logging :)

    Regards
    Johan

     
  • Natsuki
    Natsuki
    2011-06-09

    Thanks!
    I think I am going to ask a few more questions, though.
    But since they're probably not related to Bluetooth, I'll start a new thread when appropriate.
    I'm still evaluating different methods of getting the logs sent to me from the application.