Skip to main content
ツイート済み twitter.com/jaStackOverflow/status/1139185924158447616
本文に 58 文字追加
ソース リンク
kishikawa katsumi
  • 8,520
  • 2
  • 18
  • 40

Exception in thread "main" java.lang.UnsatisfiedLinkError:
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion()I at
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion(Native
Method) at
com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:964)
at
com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:502)
at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:69)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1044) at
java.security.AccessController.doPrivileged(Native Method) at
com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1042)
at
com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1035)
at
com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:196)
at
com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:525)
at javax.microedition.io.Connector.open(Connector.java:113) at
application.BTServer.(BTServer.java:32) at
application.BTServer.main(BTServer.java:103)

Exception in thread "main" java.lang.UnsatisfiedLinkError:
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion()I     at
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion(Native
Method)   at
com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:964)
  at
com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:502)
  at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:69)
  at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1044)   at
java.security.AccessController.doPrivileged(Native Method)    at
com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1042)
  at
com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1035)
  at
com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:196)
  at
com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:525)
  at javax.microedition.io.Connector.open(Connector.java:113)     at
application.BTServer.<init>(BTServer.java:32)     at
application.BTServer.main(BTServer.java:103)

Exception in thread "main" java.lang.UnsatisfiedLinkError:
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion()I at
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion(Native
Method) at
com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:964)
at
com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:502)
at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:69)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1044) at
java.security.AccessController.doPrivileged(Native Method) at
com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1042)
at
com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1035)
at
com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:196)
at
com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:525)
at javax.microedition.io.Connector.open(Connector.java:113) at
application.BTServer.(BTServer.java:32) at
application.BTServer.main(BTServer.java:103)

Exception in thread "main" java.lang.UnsatisfiedLinkError:
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion()I     at
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion(Native
Method)   at
com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:964)
  at
com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:502)
  at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:69)
  at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1044)   at
java.security.AccessController.doPrivileged(Native Method)    at
com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1042)
  at
com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1035)
  at
com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:196)
  at
com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:525)
  at javax.microedition.io.Connector.open(Connector.java:113)     at
application.BTServer.<init>(BTServer.java:32)     at
application.BTServer.main(BTServer.java:103)
ソース リンク
root
  • 39
  • 1

BlueCove-2.1.1-SNAPSHOT.jarでのUnsatisfiedLinkError

PC-Android間でBluetooth通信を行うアプリを作るため、調べていたところ、BlueCoveというものを発見しました。
そこで、BlueCove-2.1.1-SNAPSHOTをダウンロードし、以下のHP
( http://www.kotemaru.org/2013/10/30/android-bluetooth-sample.html )のソースコードをほとんどそのままコピー(UUID,プロジェクト名のみ変更)してテストを行おうとしました。
しかし、実行時点でエラーが発生し、解決方法がわかりません。
以下ソースコード

package application;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Date;

import javax.bluetooth.LocalDevice;
import javax.bluetooth.ServiceRecord;
import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
import javax.microedition.io.StreamConnectionNotifier;


/**
 * 英大文字変換エコーバック Bluetooth サーバ。
 */
public class BTServer {
    /**
     * UUIDは独自プロトコルのサービスの場合は固有に生成する。
     * - 各種ツールで生成する。(ほぼ乱数)→乱数で生成
     * - 注:このまま使わないように。→変更した
     */
    static final String serverUUID = "26195557833207509390042112996003";

    //初期化
    private StreamConnectionNotifier server = null;

    public BTServer() throws IOException {
        // RFCOMMベースのサーバの開始。
        // - btspp:は PRCOMM 用なのでベースプロトコルによって変わる。
        server = (StreamConnectionNotifier) Connector.open(
                "btspp://localhost:" + serverUUID,
                Connector.READ_WRITE, true
        );
        // ローカルデバイスにサービスを登録。必須ではない。
        ServiceRecord record = LocalDevice.getLocalDevice().getRecord(server);
        LocalDevice.getLocalDevice().updateRecord(record);
    }

    /**
     * クライアントからの接続待ち。
     * @return 接続されたたセッションを返す。
     */
    public Session accept() throws IOException {
        log("Accept");
        StreamConnection channel = server.acceptAndOpen();
        log("Connect");
        return new Session(channel);
    }
    public void dispose() {
        log("Dispose");
        if (server  != null) try {server.close();} catch (Exception e) {/*ignore*/}
    }

    /**
     * セッション。
     * - 並列にセッションを晴れるかは試していない。
     * - 基本的に Socket と同じ。
     */
    static class Session implements Runnable {
        private StreamConnection channel = null;
        private InputStream btIn = null;
        private OutputStream btOut = null;

        public Session(StreamConnection channel) throws IOException {
            this.channel = channel;
            this.btIn = channel.openInputStream();
            this.btOut = channel.openOutputStream();
        }

        /**
         * 英小文字の受信データを英大文字にしてエコーバックする。
         * - 入力が空なら終了。
         * ここでXbeeからのデータを送信する。
         */
        public void run() {
            try {
                byte[] buff = new byte[512];
                int n = 0;
                while ((n = btIn.read(buff)) > 0) {
                    String data = new String(buff, 0, n);
                    log("Receive:"+data);
                    btOut.write(data.toUpperCase().getBytes());
                    btOut.flush();
                }
            } catch (Throwable t) {
                t.printStackTrace();
            } finally {
                close();
            }
        }
        public void close() {
            log("Session Close");
            if (btIn    != null) try {btIn.close();} catch (Exception e) {/*ignore*/}
            if (btOut   != null) try {btOut.close();} catch (Exception e) {/*ignore*/}
            if (channel != null) try {channel.close();} catch (Exception e) {/*ignore*/}
        }
    }

    //------------------------------------------------------
    public static void main(String[] args) throws Exception {
        BTServer server = new BTServer();
        while (true) {
            Session session = server.accept();
            new Thread(session).start();
        }
        //server.dispose();
    }
    private static void log(String msg) {
        System.out.println("["+(new Date()) + "] " + msg);
    }
}

以下エラー

Exception in thread "main" java.lang.UnsatisfiedLinkError:
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion()I at
com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion(Native
Method) at
com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:964)
at
com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:502)
at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:69)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1044) at
java.security.AccessController.doPrivileged(Native Method) at
com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1042)
at
com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1035)
at
com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:196)
at
com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:525)
at javax.microedition.io.Connector.open(Connector.java:113) at
application.BTServer.(BTServer.java:32) at
application.BTServer.main(BTServer.java:103)

実行環境は
使用PC:Windows7 64bit
Bluetooth:bluecore csr8510 a10
開発環境:Eclipse4.4 64bit版

どのように解決すればよいのかわかりません。解決方法を教えて下さい。