Couchbase lite p2p replication failed

Hey there.

I got trouble with p2p replication on android app. I got photo drop application which send photos via couchbase lite,
but when I try push replication, I got this exception

Router unable to route request to do_PUT_Document

java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.couchbase.lite.router.Router.start(Router.java:534)
at com.couchbase.lite.listener.LiteServlet.service(LiteServlet.java:141)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2251)
at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2176)
at Acme.Serve.Serve$ServeConnection.run(Serve.java:1988)
at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1223)
at java.lang.Thread.run(Thread.java:841)
Caused by: com.couchbase.lite.CouchbaseLiteException, Status: 406 (HTTP 406 not_acceptable)
at com.couchbase.lite.router.Router.getBodyAsDictionary(Router.java:203)
at com.couchbase.lite.router.Router.do_PUT_Document(Router.java:2119)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.couchbase.lite.router.Router.start(Router.java:534)
at com.couchbase.lite.listener.LiteServlet.service(LiteServlet.java:141)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2251)
at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2176)
at Acme.Serve.Serve$ServeConnection.run(Serve.java:1988)
at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1223)
at java.lang.Thread.run(Thread.java:841)

Are there any ideas how to fix this?

Hi dmxskipi,
Could you provide a little more context about how you’re testing this?
Are you using Wifi? Is this all on simulators? hardware with debug mode?
Happy to help if I can!

Austin

@hideki: This looks like some sort of internal error in the router. (unable to route request to do_PUT_Document) Could this be a configuration problem, like a missing Jar file or something?

From the exception @dmxskipi posted, Exception was thrown because of content-type is not application/json. It seems push replicator does not set correct content-type.