andreivasiliu2211 / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

Bluecove broken on OSX 10.8 #134

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to run Bluecove in any project on 10.8
2. Fail
3.

What is the expected output? What do you see instead?

Project crashes on launch (using http://www.uweschmidt.org/wiimote-whiteboard 
for example)
Here is the Console Log:

(see attached txt)

What BlueCove version are you using (include build number for SNAPSHOT)? On 
what operating system and jvm? Is this 64-bit or 32-bit OS and jvm?

OSX 10.8, 64-bit
Jave SE6, 32-bit and 64-bit

Please provide any additional information below.
Please use "Attach a file" when uploading stack traces or other big files!

Original issue reported on code.google.com by JesseColinScott on 6 Sep 2012 at 9:07

Attachments:

GoogleCodeExporter commented 9 years ago
I see the same problem when loading a Bluetooth related OSGi bundle in the 
OpenHAB project. This bundle is using bluecove-2.1.1-SNAPSHOT.61, running on OS 
X 10.8.2. Java JDK information:
    $ java -version
    java version "1.6.0_35"
    Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
    Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode) 

The error I see in the log output is:
dyld: lazy symbol binding failed: Symbol not found: 
_IOBluetoothLocalDeviceReadSupportedFeatures
  Referenced from: /private/var/folders/vq/9w6g_qjs2_jdvt73j3f2k6lh0000gn/T/bluecove_edmund_0/libbluecove.jnilib
  Expected in: /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth

dyld: Symbol not found: _IOBluetoothLocalDeviceReadSupportedFeatures
  Referenced from: /private/var/folders/vq/9w6g_qjs2_jdvt73j3f2k6lh0000gn/T/bluecove_edmund_0/libbluecove.jnilib
  Expected in: /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth

Maybe Java is trying to call a function through JNI that does not exist in the 
shared lib?

Original comment by edmund.t...@gmail.com on 30 Sep 2012 at 5:46

GoogleCodeExporter commented 9 years ago
We are seeing this issue as well on multiple OSX 10.8.1 installs:

dyld: lazy symbol binding failed: Symbol not found: 
_IOBluetoothLocalDeviceReadSupportedFeatures Referenced from: 
/private/var/folders/g8/p4612lyn7q31ltdwy62c1z5c0000gn/T/bluecove_bobby_0/libblu
ecove.jnilib Expected in: 
/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth dyld: 
Symbol not found: _IOBluetoothLocalDeviceReadSupportedFeatures Referenced from: 
/private/var/folders/g8/p4612lyn7q31ltdwy62c1z5c0000gn/T/bluecove_bobby_0/libblu
ecove.jnilib Expected in: 
/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth 

- - - - - - - - - - - - - 

dyld: lazy symbol binding failed: Symbol not found: 
_IOBluetoothLocalDeviceReadSupportedFeatures Referenced 
from:Ê/private/var/folders/vr/rdzg63f931z96s37m9y93t0h0000gp/T/bluecove_denise_
0/libbluecove.jnilib Expected 
in:Ê/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth 
dyld: Symbol not found: 
_IOBluetoothLocalDeviceReadSupportedFeaturesÊReferenced from: 
/private/var/folders/vr/rdzg63f931z96s37m9y93t0h0000gp/T/bluecove_denise_0/libbl
uecove.jnilib Expected 
in:Ê/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetoothÊ

Original comment by danielba...@gmail.com on 10 Oct 2012 at 8:35

GoogleCodeExporter commented 9 years ago
Seems like IOBluetoothLocalDeviceReadSupportedFeatures has been removed by 
Apple.https://developer.apple.com/library/mac/#releasenotes/General/APIDiffsMacO
SX10_8/IOBluetooth.html However I have no idea about how to fix it. 
Unfortunately.

Original comment by moller2...@gmail.com on 11 Oct 2012 at 3:48

GoogleCodeExporter commented 9 years ago
Is it possible that IOBluetoothLocalDeviceReadSupportedFeatures has been 
replaced   kBluetoothHCICommandLEReadLocalSupportedFeatures? 

Clearly, the old call is not coming back. To un-break this, Apple's new call(s) 
need to be added to BlueCove.

Original comment by bob.star...@gmail.com on 16 Oct 2012 at 1:36

GoogleCodeExporter commented 9 years ago
Note that a temporary workaround has been found:

 * https://groups.google.com/forum/?hl=en&fromgroups#!msg/bluecove-users/7jWv1V1GC-4/6pShd9vssAEJ

 * http://www.uweschmidt.org/wiimote-whiteboard/comment-page-45#comment-246167

As it involves copying a system file (IOBluetooth) from a previous version of 
OS X and using DYLD_LIBRARY_PATH  it is not a permanent end user solution for 
both technical and legal reasons.

Original comment by follower@gmail.com on 4 Dec 2012 at 12:50

GoogleCodeExporter commented 9 years ago
jepp, that worked for me. download the IOBluetooth file from uwe and change the 
startup script in order to start eclipse like this: 
http://pastebin.com/raw.php?i=TgEcCW2G

Original comment by cpietsch on 11 Jan 2013 at 12:04

GoogleCodeExporter commented 9 years ago
is anybody gettin 
/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth lib 
somewhere ?

I would like to get some bundling of mine for my java app.

thanks

Original comment by lucas.bigeardel@gmail.com on 13 Jan 2013 at 7:40

GoogleCodeExporter commented 9 years ago
I just created a new version of the OS X stack that utilizes Grand Central 
Dispatch for asynchronous tasks and supports the latest 10.8 Bluetooth-Stack. 
How could we stabilize and incorporate this into bluecove. I ask in particular 
for intensive testing of all the different functions that i could not verify in 
my environment.

In addition, this version most likely will not work with older versions of OS 
X, so maybe it could be easier to split the two into a pre 10.8 and 10.8+ 
binary that are loaded depending on the runtime environment.

Original comment by die.paul...@googlemail.com on 11 Feb 2013 at 10:26

GoogleCodeExporter commented 9 years ago
@die.paulinis: I would be very interested in these patches because I have an 
application that I can't get to run on OS X 10.8. Do you have the patches 
uploaded somewhere or is there a precompiled version with your changes that I 
can get access to?

As for the integration with bluecove I think it would be a good idea to create 
a new binary for 10.8+ and leave the old binary alone. This way you can easily 
make sure that no existing (10.7) functionality will become broken.

Original comment by littlefr...@gmail.com on 21 Feb 2013 at 8:44

GoogleCodeExporter commented 9 years ago
@die.paulinis: I am also very interested in those patches, since I get the same 
errors too ...

Original comment by cmueller...@gmail.com on 8 Apr 2013 at 1:30

GoogleCodeExporter commented 9 years ago
Sorry but i did not receive any mails for your comments and was kind of 
surprised that nobody was interested in this.

I will figure out some easy way to share the code with you. Most likely i will 
push the code to github tomorrow. I will share the location with you ASAP.

Original comment by die.paul...@googlemail.com on 12 Apr 2013 at 9:31

GoogleCodeExporter commented 9 years ago
@die.paulinis I would also be very interested in these changes. Did you have 
the chance to upload them somewhere?

Original comment by Smm...@gmail.com on 16 Apr 2013 at 8:44

GoogleCodeExporter commented 9 years ago
@all: You can find the forked repository at github: 
https://github.com/ma-ku/bluecove. Actually i did not change the java code and 
only worked on the native library. All the changes are made in 
OSXStackRFCOMM.mm, mainly i changed everything to utilize GCD and semaphores. 

I am able to use the library with LeJOS to program and control my NXT brick. 
Unfortunately the transmission to the brick is rather slow since only a few 
bytes are sent on each call. If anyone of you knows a way to speed this up, i 
would appreciate contributions to the code.

Have fun...

Original comment by die.paul...@googlemail.com on 16 Apr 2013 at 8:34

GoogleCodeExporter commented 9 years ago
I used a workaround to fix this issue for blucat. I modify the 
DYLD_LIBRARY_PATH variable to contain an older IOBluetooth library that works. 
For this I don't need to change any jar files. You just modify this variable on 
new max versions.

Launcher script here:
http://svn.code.sf.net/p/blucat/code/trunk/blucat/blucat

Original comment by jos...@josephpcohen.com on 20 Apr 2013 at 3:25

GoogleCodeExporter commented 9 years ago
Well, i have seen these approaches. Nevertheless i personally prefer a solution 
that does not rely on exchanging system libraries. As i already wrote, the 
library is working except for the performance issue with the RFCOMM Channel and 
i would appreciate a solution to that issue, going with the original system 
libraries of OS X 10.8.x.

Original comment by die.paul...@googlemail.com on 22 Apr 2013 at 2:16

GoogleCodeExporter commented 9 years ago
@die.paulinis: Thanks for sharing your changes. I will have a look at it to see 
how it performs for my case. (I didn't get any emails for the comments either, 
I saw only just now that you responded to my comment)

Original comment by littlefr...@gmail.com on 10 May 2013 at 12:42

GoogleCodeExporter commented 9 years ago
Has this been resolved?  i.e. Has Bluecove released a new version that works on 
OSX 10.8?

Original comment by cagiva...@gmail.com on 10 Jun 2013 at 6:11

GoogleCodeExporter commented 9 years ago
@ cagiva851: I did a personal build of the required .dylib using XCode and used 
this file to replace the original version in the bluecove.jar. Anyway, the code 
was released on github so you should be able to do your own build. I personally 
have not spend any effort on how to run a complete build of bluecove so maybe 
anyone can assist?

Original comment by die.paul...@googlemail.com on 11 Jun 2013 at 7:52

GoogleCodeExporter commented 9 years ago
Hello,
I just download https://github.com/ma-ku/bluecove and I'm still experience very 
slow connection to my NXT

Any suggestion?

Serano

Original comment by serano.c...@gmail.com on 22 Jun 2013 at 6:41

GoogleCodeExporter commented 9 years ago
Hi guys,

Have anyone found or documented a working solution, which is replicated by 
other people? I tried all suggestions and none works for me. :(     Any 
guidance would be very much appreciated!

1. I have MAC and I do not believe that there is hcitool equivalent on Mac.

2. A solution from Uwe: Changing the DYLD_LIBRARY_PATH environment variable to 
point to the old IOBluetooth library gives this error:
...
22:51:52.723 Java 1.4+ detected: 1.6.0_65; Java HotSpot(TM) 64-Bit Server VM; 
Apple Inc.
      com.intel.bluetooth.UtilsJavaSE.getLocation(UtilsJavaSE.java:121)
22:51:52.738 Use stack ClassLoader
      com.intel.bluetooth.NativeLibLoader.loadAsSystemResource(NativeLibLoader.java:328)
22:51:52.739 set dll dir 
/var/folders/3l/0h021ffn68953c7gccvkd4p00000gn/T/bluecove_user_0
      com.intel.bluetooth.NativeLibLoader.makeTempName(NativeLibLoader.java:471)
22:51:52.790 Library loaded from 
/var/folders/3l/0h021ffn68953c7gccvkd4p00000gn/T/bluecove_user_0/libbluecove.jni
lib
      com.intel.bluetooth.NativeLibLoader.loadAsSystemResource(NativeLibLoader.java:371)
22:51:52.790 BluetoothStack selected mac
      com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:499)
22:51:52.791 nativeDebugCallback ON
      common.cpp:63
22:51:52.791 getLocalDeviceSupportedSoftwareVersion
      OSXStack.mm:539
NATIVE:      invoke    BTOperation GetLocalDeviceVersion
    OSXStack.mm(240)
NATIVE:       execute  BTOperation GetLocalDeviceVersion
    OSXStack.mm(223)
NATIVE:       finished BTOperation GetLocalDeviceVersion
    OSXStack.mm(225)
NATIVE:      return    BTOperation GetLocalDeviceVersion
    OSXStack.mm(248)
22:51:52.795 localDeviceSupportedSoftwareVersion 20000
      com.intel.bluetooth.BluetoothStackOSX.initialize(BluetoothStackOSX.java:132)
22:51:52.802 isLocalDeviceFeatureParkMode
      OSXStack.mm:497
NATIVE:      invoke    BTOperation GetBluetoothHCISupportedFeatures
    OSXStack.mm(240)
NATIVE:       execute  BTOperation GetBluetoothHCISupportedFeatures
    OSXStack.mm(223)
NATIVE:       finished BTOperation GetBluetoothHCISupportedFeatures
    OSXStack.mm(225)
Assertion failed: (notificationType == 
kIOBluetoothHCINotificationTypeConfigStateChanged), function 
IOBluetoothNotificationLibHCIRawEventHandler, file 
/SourceCache/IOBluetoothFamily/IOBluetoothFamily-4080.4.17/Core/Framework/Notifi
cations/IOBluetoothNotificationUserLib.m, line 425.
....

3, Solution from: emnul...@googlemail.com: Changing bluecove.jar to the latest 
snapshot taken from this links:
https://github.com/ixd-hof/Processing/tree/master/Examples/Input/Wiimote_Balance
Board/code
gives an error:
...
22:55:28.941 Java 1.4+ detected: 1.6.0_65; Java HotSpot(TM) 64-Bit Server VM; 
Apple Inc.
      com.intel.bluetooth.UtilsJavaSE.getLocation(UtilsJavaSE.java:121)
22:55:28.950 error Can't load library from path 
/Users/user/OpenHab/openhab-runtime java.lang.UnsatisfiedLinkError: 
/Users/user/OpenHab/openhab-runtime-1.4.0/libbluecove.jnilib:  no suitable 
image found.  Did find:  
/Users/user/OpenHab/openhab-runtime-1.4.0/libbluecove.jnilib: mach-o, but wrong 
architecture
      com.intel.bluetooth.NativeLibLoader.tryloadFile(NativeLibLoader.java:304)
java.lang.UnsatisfiedLinkError: 
/Users/user/OpenHab/openhab-runtime-1.4.0/libbluecove.jnilib:  no suitable 
image found.  Did find:  
/Users/user/OpenHab/openhab-runtime-1.4.0/libbluecove.jnilib: mach-o, but wrong 
architecture
...

Original comment by de...@google.com on 2 Dec 2013 at 7:15

GoogleCodeExporter commented 9 years ago
You can check out the code from https://github.com/ma-ku/bluecove and compile 
it on your machine. Then add the resulting library to your java.library.path.

I've attached the bluecove jar that I use on my machine (compiled some weeks 
ago). Maybe it will work for you too.

Original comment by littlefr...@gmail.com on 4 Dec 2013 at 4:51

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you! I will try tonight

Original comment by de...@google.com on 4 Dec 2013 at 5:52

GoogleCodeExporter commented 9 years ago
I upgraded to OSX 10.9 before I tried the attached file and it didn't work. 
However I compiled https://github.com/ma-ku/bluecove on my machine and it seems 
to work. Actually, it doesn't give any error, it correctly shows unknown / 
unpaired devices, but it always shows zero paired devices, when Mac sees 
several paired devices. Don't know where to go from here :(

Original comment by de...@google.com on 10 Dec 2013 at 8:20

GoogleCodeExporter commented 9 years ago
How do you look up the paired devices? Looking up paired devices should be 
supported (the changes where merged into the codebase at 
https://github.com/ma-ku/bluecove). I also use OSX 10.9 and it seems to workf 
for me. Can you provide your java code?

Original comment by littlefr...@gmail.com on 14 Dec 2013 at 12:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thank's littlefr...@gmail.com!! That jar worked like a charm after struggling 
with this problem for a really long time.
bluecove-2.1.2.jar  workes great on OSX 10.9.

Original comment by weisss...@gmail.com on 30 Dec 2013 at 3:20

GoogleCodeExporter commented 9 years ago
Hello. I am trying to run a BT app with bluecove on maverick, so I tried to use 
the jar file provided by littlefr, but I got this error message

java.lang.UnsatisfiedLinkError: 
/private/var/folders/b9/cf61_fyx3jg9p7h3tms0vkk40000gn/T/bluecove_weibel_0/libbl
uecove.jnilib:  no suitable image found.  Did find:  
/private/var/folders/b9/cf61_fyx3jg9p7h3tms0vkk40000gn/T/bluecove_weibel_0/libbl
uecove.jnilib: mach-o, but wrong architecture

I also tried to build the library myself using the github code, but I can't 
because of those issues:

The following build commands failed:
    CompileC build/bluecove.build/Release/bluecove.build/Objects-normal/i386/commonTest.o commonTest.cpp normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/bluecove.build/Release/bluecove.build/Objects-normal/i386/OSXStack.o OSXStack.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/bluecove.build/Release/bluecove.build/Objects-normal/i386/OSXStackDiscovery.o OSXStackDiscovery.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/bluecove.build/Release/bluecove.build/Objects-normal/i386/OSXStackSDPQuery.o OSXStackSDPQuery.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/bluecove.build/Release/bluecove.build/Objects-normal/i386/OSXStackTest.o OSXStackTest.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(5 failures)

Anyone has any guidance?

Thanks a lot

Nadir

Original comment by nadir.we...@gmail.com on 27 Jan 2014 at 10:03

GoogleCodeExporter commented 9 years ago
I think that my problem was related to the GUI implementation. I used the 
standard SWT that for some reasons is 32bit, so I was running my app 32bit. I 
now included a 64bit SWT library and I am running my app at 64bit, and it seems 
to work.

Still I don't know why I can't build the library though...

NW

Original comment by nadir.we...@gmail.com on 27 Jan 2014 at 10:32

GoogleCodeExporter commented 9 years ago
Hi,

I'm trying to get LEJOS to work on OS X. So far I've been through the following 
steps:

1. Clone https://github.com/ma-ku/bluecove
2. Open the bluecove XCode project, set target to 32-bit, and compile the 
library (had to remove a few includes which weren't used).
3. Installed ant to compile the bluecove jar file (with success). I replaced 
the bluecove.jar in LEJOS with the one I just compiled, which fixed some errors.

So now I only have to get it working with Eclipse.

java.lang.UnsatisfiedLinkError: 
/private/var/folders/t3/qv5vkj3j2ks_bnxtrms6gd580000gn/T/bluecove_das_0/libbluec
ove.jnilib:  no suitable image found.  Did find:  
/private/var/folders/t3/qv5vkj3j2ks_bnxtrms6gd580000gn/T/bluecove_das_0/libbluec
ove.jnilib: mach-o, but wrong architecture
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1833)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1019)
    at com.intel.bluetooth.NativeLibLoader.loadAsSystemResource(NativeLibLoader.java:400)
    at com.intel.bluetooth.NativeLibLoader.isAvailable(NativeLibLoader.java:252)
    at com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries(BlueCoveImpl.java:401)
    at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:472)
    at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:70)
    at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1085)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1083)
    at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1076)
    at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
    at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
    at lejos.pc.comm.NXTCommBluecove.search(NXTCommBluecove.java:45)
    at lejos.pc.comm.NXTConnector.search(NXTConnector.java:173)
    at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:235)
    at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:55)
    at lejos.pc.tools.Upload.upload(Upload.java:38)
    at lejos.pc.tools.NXJUpload.run(NXJUpload.java:93)
    at lejos.pc.tools.NXJUpload.start(NXJUpload.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
    at lejos.pc.tools.NXJUpload.main(NXJUpload.java:29)
Native Library bluecove not available
leJOS NXJ> Error: Search failed.
leJOS NXJ> Caused by lejos.pc.comm.NXTCommException: Bluetooth stack not 
detected
leJOS NXJ>  at lejos.pc.comm.NXTCommBluecove.search(NXTCommBluecove.java:54)
leJOS NXJ> Caused by javax.bluetooth.BluetoothStateException: BlueCove library 
bluecove not available;
load resource 
[/var/folders/t3/qv5vkj3j2ks_bnxtrms6gd580000gn/T/bluecove_das_0/libbluecove.jni
lib] 
/private/var/folders/t3/qv5vkj3j2ks_bnxtrms6gd580000gn/T/bluecove_das_0/libbluec
ove.jnilib:  no suitable image found.  Did find:  
/private/var/folders/t3/qv5vkj3j2ks_bnxtrms6gd580000gn/T/bluecove_das_0/libbluec
ove.jnilib: mach-o, but wrong architecture
load [bluecove] no bluecove in java.library.path
leJOS NXJ>  at 
com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries(BlueCoveImpl.java:403)

So it seems that the only thing I'm missing is to properly set 
java.library.path. Any hints on this? I tried the things that people have shown 
so far, but with no luck.

Thanks.

Original comment by dan1990 on 30 Jan 2014 at 1:47

GoogleCodeExporter commented 9 years ago
@dan1990: Mabe this helps: 
http://stackoverflow.com/questions/2282548/java-lang-unsatisfiedlinkerror-mach-o
-but-wrong-architecture-on-mac10-6-2

Original comment by littlefr...@gmail.com on 30 Jan 2014 at 6:38

GoogleCodeExporter commented 9 years ago
#30: I found out that running the LEJOS tools directly (without Eclipse) on a 
32-bit JVM 6 gives the same error. From the source of the LEJOS tools I found 
out that it automatically sets -d32 on OS X, so this doesn't seem to be the 
cause of the error.

I just tried doing it all over and now I get the error (I realized that I had 
some old bluecove jars in the classpath, so changes to the new one never had 
any effect since it was loaded later):

java.lang.NoClassDefFoundError: javax/bluetooth/DiscoveryListener
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:171)
    at lejos.pc.comm.NXTCommFactory.newNXTCommInstance(NXTCommFactory.java:98)
    at lejos.pc.comm.NXTCommFactory.createNXTComm(NXTCommFactory.java:91)
    at lejos.pc.comm.NXTConnector.search(NXTConnector.java:111)
    at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:235)
    at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:55)
    at lejos.pc.tools.Upload.upload(Upload.java:38)
    at lejos.pc.tools.NXJUpload.run(NXJUpload.java:93)
    at lejos.pc.tools.NXJUpload.start(NXJUpload.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
    at lejos.pc.tools.NXJUpload.main(NXJUpload.java:29)
Caused by: java.lang.ClassNotFoundException: javax.bluetooth.DiscoveryListener
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 28 more
uploading the program failed with exit status 1

Thanks for helping out with this :-)

Original comment by dan1990 on 6 Feb 2014 at 11:45

GoogleCodeExporter commented 9 years ago
How I did the following:

1. Clone https://github.com/ma-ku/bluecove
2. Open the bluecove XCode project, set target to 32-bit, and compile the 
library (had to remove a few includes which weren't used). This produces 
libbluecove.jnilib
3. I then ran ant in the "bluecove" directory which produces two directories: 
com and javax, which contain various class files.
4. I zipped the com, javax and libbluecove.jnilib and renamed the file to 
"bluecove.jar" and replaced it with the one which ships with LEJOS.

When running one of the LEJOS tools which connects via USB, I get the following 
error:

java.lang.UnsatisfiedLinkError: 
com.intel.bluetooth.BluetoothStackOSX.getLibraryVersion()I
    at com.intel.bluetooth.BluetoothStackOSX.getLibraryVersion(Native Method)
    at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:487)
    at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:70)
    at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1085)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1083)
    at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1076)
    at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
    at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
    at lejos.pc.comm.NXTCommBluecove.search(NXTCommBluecove.java:45)
    at lejos.pc.comm.NXTConnector.search(NXTConnector.java:173)
    at lejos.pc.tools.NXJBrowser.run(NXJBrowser.java:99)
    at lejos.pc.tools.NXJBrowser.start(NXJBrowser.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
    at lejos.pc.tools.ToolStarter$1.run(ToolStarter.java:15)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

It seems that I'm getting closer, but I don't know how to proceed from here. 
Any help is greatly appreciated :-)

- Dan

Original comment by dan1990 on 6 Feb 2014 at 12:11

GoogleCodeExporter commented 9 years ago
Building the ma-ku fork from github I hit an issue where javah was not 
generating headers so I had missing files for some native includes

#include "com_intel_bluetooth_NativeTestInterfaces.h"

The issue turned out to be the javah task I had for maven 2 is expecting a 
different syntax

In bluecove/bluecove/pom.xml

<configuration>
    <outputDirectory>${native.source.dir}</outputDirectory>     
    <classNames>...

Had to be changed to this - seems the config property names have changed.

<configuration>
    <javahOutputDirectory>${native.source.dir}</javahOutputDirectory>     
    <javahClassNames>

Original comment by lordpi...@mac.com on 15 Mar 2014 at 1:40

GoogleCodeExporter commented 9 years ago
I've built the library successfully from ma-ku fork, but I get an hard crash 
(log attached).
All tests during build are successful.
The only difference I see is that I'm using a recent VM, instead of the 1.6
Did anyone share the same problem or a clue?

Mario

java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

Original comment by m.NegroP...@xs2theworld.com on 2 Aug 2014 at 10:32

Attachments:

GoogleCodeExporter commented 9 years ago
Since development appears to have stopped back in 2011, I suspect you're on 
your own.

Original comment by paul.har...@technowizardry.co.uk on 3 Aug 2014 at 9:24

GoogleCodeExporter commented 9 years ago
I found for 10.9 many things break.  I found the jarias bluecove update 
(https://github.com/jarias/bluecove) is best and allows RFCOMM sockets but 
scanning is broken and I think many other things. 

I attributed it not working in 10.9 to Apple changing their interface. I was 
running bluecove on 10.7 and 10.8 by just setting DYLD_LIBRARY_PATH to point to 
an old IOBluetooth object from 10.6. But this doesn't work anymore so I think 
Apple changed things.

Original comment by jos...@josephpcohen.com on 3 Aug 2014 at 2:41

GoogleCodeExporter commented 9 years ago
I use this library for my project which need to connect LEGO Mindstorms NXT via 
bluetooth, and had problems on Max OS X Yosemite Beta 2.

I've rebuild the bluecove library with some fixes form the jarias update 
(https://github.com/jarias/bluecove), and it works for me. I believe this can 
work both on Mavericks and Yosemite Beta 2.

-
Kris

Original comment by mrcotter...@gmail.com on 15 Sep 2014 at 4:52

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Kris,
your version works much better but I'm still having issues while reconnecting. 
Can you share your fixes to the jarias update?

Mario

Original comment by m.NegroP...@xs2theworld.com on 24 Oct 2014 at 1:12

GoogleCodeExporter commented 9 years ago
Hi, are the problems on Yosemite sorted out by now? If so, can someone please 
compile a version that will run on 10.8 up to the latest 10.10.X?

Thanks,
Uwe

Original comment by uschmidt83@googlemail.com on 3 Dec 2014 at 6:34

GoogleCodeExporter commented 9 years ago
Hello all... I am the developer of www.aioremote.net mobile remote app and was 
searching a lot for a fix for bluetoth on mac and finally found the fix here. 
Thank you very much

I tested  bluecove-2.1.1.jar  provided by Kris and it worked on my Mac 10.10 
Yosemite

I will do more tests before updating my desktop app but I wanted to let you 
know the result of my initial tests

Original comment by supp...@aioremote.net on 6 Dec 2014 at 2:28

GoogleCodeExporter commented 9 years ago
I have had success on Mac OSX 10.9.5 using the bluecove version from: 

   https://github.com/machaval/bluecove

The issue with slow interaction with Lego NXT that was reported above can be 
fixed by making some
changes to the OSXStackRFCOMM.mm file (in bluecove/src/main/c/intelbth).  In a 
number of places the following is used:

   dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_MSEC * 500));

Performance can be improved (at least in my case) by changing all of those 
lines to:

   dispatch_time(DISPATCH_TIME_NOW, 1));

The modified file is attached.  Just replace it in the source from the git 
above and run maven in the bluecove directory.

Or... I have also attached a the resulting Jar file that may work for you 
straight away.

Good luck!

Original comment by braug...@gmail.com on 4 Mar 2015 at 10:04

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks a lot! It worked perfectly and 3-5 times faster.
Is there a fix for the reconnect bug? 
I hope there is, because disconnecting the NXT and restarting eclipse needs as 
much as time as if I plug the USB cable in and out.
But thanks again for the great work.

Original comment by Benedikt...@gmail.com on 2 Jun 2015 at 9:03