私のMac 10.9.2では、ソファベースサーバーをインストールし、それを実行しhttp://127.0.0.1:8091
ています.beer-sampleを含むデフォルトのバケットがあります
同期サーバーを次のように起動しました
./sync_gateway -bucket="beer-sample"
コンソールに次のように記録します
14:00:55.903306 ==== Couchbase Sync Gateway/0.94 ====
14:00:55.979850 Configured Go to use all 2 CPUs; setenv GOMAXPROCS to override this
14:00:55.979985 Configured MaxFileDescriptors (RLIMIT_NOFILE) to 5000
14:00:56.005329 Opening db /beer-sample as bucket "beer-sample", pool "default", server <walrus:>
14:00:56.019242 Opening Walrus database beer-sample on <walrus:>
14:00:56.057276 Using default sync function 'channel(doc.channels)' for database "beer-sample"
14:00:56.057549 Starting profile server on
14:00:56.057680 Starting admin server on 127.0.0.1:4985
14:00:56.090556 Starting server on :4984 ...
アンドロイドでは、私の複製コードは次のようになります
Replication pullReplication = database.createPullReplication("http://10.0.2.2:4984");
pullReplication.start();
次に、シミュレータでAndroidアプリを実行し、changeEventListenerのようにエラーを記録しました
if (!replication.isRunning()){
Log.d(TAG, "Replication is not running due to " + replication.getLastError().getMessage());
Log.d(TAG, "Replication is not running due to " + replication.getLastError().getCause());
Log.d(TAG, "Replication is not running due to " + replication.getLastError().getStackTrace());
Log.d(TAG, "Replication is not running due to " + replication.getLastError().toString());
}
ログを記録した
04-04 14:04:18.402 1622-1644/com.couchbase.replicationsample.replicationsample D/HelloWorld﹕ Replication: Puller[http://10.0.2.2:4984] changed.
04-04 14:04:18.432 1622-1644/com.couchbase.replicationsample.replicationsample D/HelloWorld﹕ Replication is not running due to HTTP/1.1 404 Not Found
04-04 14:04:18.454 1622-1644/com.couchbase.replicationsample.replicationsample D/HelloWorld﹕ Replication is not running due to null
04-04 14:04:18.502 1622-1644/com.couchbase.replicationsample.replicationsample D/HelloWorld﹕ Replication is not running due to [Ljava.lang.StackTraceElement;@414efc88
04-04 14:04:18.502 1622-1644/com.couchbase.replicationsample.replicationsample D/HelloWorld﹕ Replication is not running due to com.couchbase.lite.CouchbaseLiteException: HTTP/1.1 404 Not Found
Note: I am using 10.0.2.2 instead of 127.0.0.1 because i read in forum that's how simulator maps the host machine. But i also tried 127.0.0.1 earlier which also gives the same result.
同時に、同期ゲートウェイコンソールログに次のような新しいエントリが表示されます
14:05:13.532393 HTTP: #006: GET /_changes?feed=normal&heartbeat=300000
次のようなブラウザでこのクエリを繰り返してみました
> http://127.0.0.1:4984/_changes?feed=normal&heartbeat=300000
示している
{"error":"not_found","reason":"unknown URL"}
私がここでやっている間違いは何ですか?ソファベース初心者です。