I am using following code to connect my couchabse-lite to sync gate way:
URL url = new URL(“http://localhost:4984/sync_gateway/”);
Replication push = db.createPushReplication(url);
Replication pull = db.createPullReplication(url);
pull.setContinuous(true);
push.setContinuous(true);
com.couchbase.lite.auth.Authenticator auth = AuthenticatorFactory.createBasicAuthenticator(“guest”, “!”);
push.setAuthenticator(auth);
push.setAuthenticator(auth);
pull.setAuthenticator(auth);
push.start();
pull.start();
getting following exception:
java.io.FileNotFoundException: settings.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:146)
at java.io.FileInputStream.(FileInputStream.java:101)
at omnibazaar.GreetingServer.run(GreetingServer.java:161)
Jun 02, 2015 10:29:24 PM com.couchbase.lite.util.SystemLogger e
SEVERE: RemoteRequest: Got error status: 401 for http://localhost:4984/sync_gateway/_session. Reason: Unauthorized
Jun 02, 2015 10:29:24 PM com.couchbase.lite.util.SystemLogger e
SEVERE: RemoteRequest: Got error status: 401 for http://localhost:4984/sync_gateway/_session. Reason: Unauthorized
Jun 02, 2015 10:29:24 PM com.couchbase.lite.util.SystemLogger e
SEVERE: Sync: com.couchbase.lite.replicator.ReplicationInternal$4@780c94eb: Session check failed
org.apache.http.client.HttpResponseException: Unauthorized
at com.couchbase.lite.support.RemoteRequest.executeRequest(RemoteRequest.java:222)
at com.couchbase.lite.support.RemoteRequest.run(RemoteRequest.java:104)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)