yihtserns / bluecove

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

"Native Library bluecove_arm not available" issue on arm ubuntu #146

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I tried to use bluecove-2.1.1-SNAPSHOT on my PcDuino v1 with an armv7l version 
of ubuntu. (the linaro version). I use the official version of java 1.7.0_60

I build bluecove.jar and bluecove-gpl.jar using the command "ant all" without 
any error, a bluecove_arm.so is created. 

However, I've got the following error during compilation :

using netbeans 7.0.1

run:
java.lang.UnsatisfiedLinkError: /tmp/bluecove_linaro_0/libbluecove_arm.so: 
/tmp/bluecove_linaro_0/libbluecove_arm.so: undefined symbol: sdp_extract_pdu
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
Native Library bluecove_arm not available
javax.bluetooth.BluetoothStateException: BlueCove library bluecove not 
available;
load resource [/tmp/bluecove_linaro_0/libbluecove_arm.so] 
/tmp/bluecove_linaro_0/libbluecove_arm.so: 
/tmp/bluecove_linaro_0/libbluecove_arm.so: undefined symbol: sdp_extract_pdu
load [bluecove_arm] no bluecove_arm in java.library.path
    at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
    at com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries(BlueCoveImpl.java:403)
    at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:457)
    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 java.lang.Runtime.load0(Runtime.java:795)
    at java.lang.System.load(System.java:1062)
    at com.intel.bluetooth.NativeLibLoader.loadAsSystemResource(NativeLibLoader.java:400)
    at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
    at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
    at WaitThread.waitForConnection(WaitThread.java:30)
    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:457)
    at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:70)
    at WaitThread.run(WaitThread.java:17)
    at java.lang.Thread.run(Thread.java:745)
    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 WaitThread.waitForConnection(WaitThread.java:30)
    at WaitThread.run(WaitThread.java:17)
    at java.lang.Thread.run(Thread.java:745)
BUILD SUCCESSFUL (total time: 8 seconds)

using eclipse 3.7.2

java.lang.UnsatisfiedLinkError: /tmp/bluecove_linaro_0/libbluecove_arm.so: 
/tmp/bluecove_linaro_0/libbluecove_arm.so: undefined symbol: sdp_extract_pdu
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
    at java.lang.Runtime.load0(Runtime.java:795)
    at java.lang.System.load(System.java:1062)
    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:457)
    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 WaitThread.waitForConnection(WaitThread.java:30)
    at WaitThread.run(WaitThread.java:17)
    at java.lang.Thread.run(Thread.java:745)
Native Library bluecove_arm not available
javax.bluetooth.BluetoothStateException: BlueCove library bluecove not 
available;
load resource [/tmp/bluecove_linaro_0/libbluecove_arm.so] 
/tmp/bluecove_linaro_0/libbluecove_arm.so: 
/tmp/bluecove_linaro_0/libbluecove_arm.so: undefined symbol: sdp_extract_pdu
load [bluecove_arm] 
/home/linaro/workspace/BluetoothServer/libs/libbluecove_arm.so: 
/home/linaro/workspace/BluetoothServer/libs/libbluecove_arm.so: undefined 
symbol: sdp_extract_pdu
    at com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries(BlueCoveImpl.java:403)
    at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:457)
    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 WaitThread.waitForConnection(WaitThread.java:30)
    at WaitThread.run(WaitThread.java:17)
    at java.lang.Thread.run(Thread.java:745)

I tried various solutions found on the web but not one had solved my problems 
so I hope you will be able to help me and put an end to this four days of 
research!

Regards,

76MPaul

Original issue reported on code.google.com by paul.mag...@laposte.net on 29 Aug 2014 at 4:06

GoogleCodeExporter commented 8 years ago
I success in skipping this issue replacing bluecove-gpl-2.1.1-SNAPSHOT by 
bluecove-bluez-2.1.1-SNAPSHOT.

However, I get a new issue when i called for "LocalDevice local = 
LocalDevice.getLocalDevice();"

Exception in thread "Thread-0" java.lang.NoClassDefFoundError: 
org/freedesktop/dbus/exceptions/DBusException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at com.intel.bluetooth.BlueCoveImpl.loadStackClass(BlueCoveImpl.java:358)
    at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:454)
    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 WaitThread.waitForConnection(WaitThread.java:37)
    at WaitThread.run(WaitThread.java:20)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: 
org.freedesktop.dbus.exceptions.DBusException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 14 more

Original comment by paul.mag...@laposte.net on 31 Aug 2014 at 12:03

Kanaris commented 7 years ago

I think the issue is in gcc. Default paraments are different from one version to another.

Try to use steps from my article to change build.xml for bluecove-gpl-2.1.1-SNAPSHOT.jar: 1) <property name=»bluecove.native.linker.options» value=»-nodefaultlibs«/> => <property name=»bluecove.native.linker.options» value=»»/> 2) <arg value=»-Wl,-soname,libbluecove${library_sufix}-${product_version}»/> => <arg value=»-Wl,--no-as-needed,-soname,libbluecove${library_sufix}-${product_version}»/> 3) <arg value=»-L${libs-universal}»/> <arg value=»-lbluetooth»/> <arg line=»${bluecove.native.linker.options}»/> <arg value=»-Wl,-soname,libbluecove${library_sufix}-${product_version}»/> => <arg value=»-L${libs-universal}»/> <arg line=»${bluecove.native.linker.options}»/> <arg value=»-Wl,—no-as-needed,-soname,libbluecove${library_sufix}-${product_version}»/> <arg value=»-lbluetooth»/>

http://privateblog.info/raspberry-pi-kak-rabotat-s-bluetooth-na-java/