Hello ,

I v got an exception while trying to create a document Attachment, this is 
MY Code :

var database="http://admin:admin@localhost:5984/MYDB";;
ProductAttachementGET: function(productID)                           {
                           GetImagePrincipalofproducts(productID,function(
RemoteImageData) {
                           $http({method: "GET", url: 
database+"/"+productID+"?attachments=true", cache: $templateCache}).
                           success(function(data, status) {
                           $http({
                                 url: database+'/productID/RemoteImageData
.resourceName'+data._rev,
                                 method: "PUT",
                                 data: RemoteImageData.resource,
                                 headers: {'Content-Type': 'image/jpg'}

                                 }).success(function (data, status, 
headers, config) {
                                            
console.log(JSON.stringify(data));

                                            }).error(function (data, 
status, headers, config) {
                                                     console.log(status);
                                                     });
                                   }).
                           error(function(data, status) {
                                 data = data || "Request failed";
                                 console.log("error getting my product 
!"+status);
                                 });
                                      });
       },



09-30 07:23:54.655    1342-1389/com.couchbase.Lite V/Listener﹕ Authorized 
via basic auth
09-30 07:23:55.235    1342-1389/com.couchbase.Lite E/CBLite﹕ Error 
serializing properties to JSON
    java.io.EOFException: No content to map to Object due to end of input
            at 
org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2766)
            at 
org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2709)
            at 
org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1926)
            at 
com.couchbase.lite.Database.documentPropertiesFromJSON(Database.java:1407)
            at com.couchbase.lite.View.updateIndex(View.java:535)
            at 
com.couchbase.lite.router.Router.queryDesignDoc(Router.java:1683)
            at 
com.couchbase.lite.router.Router.do_GET_DesignDocument(Router.java:1714)
            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:464)
            at 
com.couchbase.lite.listener.LiteServlet.service(LiteServlet.java:128)
            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)

09-30 07:24:50.035    1342-1409/com.couchbase.Lite V/Listener﹕ Authorized 
via basic auth
09-30 07:24:50.065    1342-1408/com.couchbase.Lite E/Router﹕ Router unable 
to route request to do_PUT_Attachment
    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:464)
            at 
com.couchbase.lite.listener.LiteServlet.service(LiteServlet.java:128)
            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
            at com.couchbase.lite.Database.putRevision(Database.java:3543)
            at 
com.couchbase.lite.Database.updateAttachment(Database.java:3020)
            at 
com.couchbase.lite.router.Router.updateAttachment(Router.java:1590)
            at 
com.couchbase.lite.router.Router.do_PUT_Attachment(Router.java:1605)
            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:464)
            at 
com.couchbase.lite.listener.LiteServlet.service(LiteServlet.java:128)
            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)

09-30 07:24:50.505    1342-1342/com.couchbase.Lite I/chromium﹕ 
[INFO:CONSOLE(938)] "404", source: file:///android_asset/www/js/services.js 
(938)

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/f64e23fa-90e4-4fe3-946b-3c6863c80f3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to