Cloudant中的PreparedAttachment中的问题 [英] Issue in PreparedAttachment in Cloudant
本文介绍了Cloudant中的PreparedAttachment中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
最近2或3天,当应用程序首次与cloudant同步时,附件下载出现问题。
Last 2 or 3 days i am getting issue in attachment download when app are sync first time with cloudant.
错误日志为:-
W/PreparedAttachment: Problem reading from input or writing to output stream java.net.ProtocolException: unexpected end of stream
at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:449)
at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168)
at java.io.InputStream.read(InputStream.java:162)
at com.cloudant.sync.datastore.PreparedAttachment.<init>(PreparedAttachment.java:83)
at com.cloudant.sync.datastore.AttachmentManager.prepareAttachment(AttachmentManager.java:213)
at com.cloudant.sync.datastore.DatastoreImpl.prepareAttachment(DatastoreImpl.java:1037)
at com.cloudant.sync.replication.DatastoreWrapper.prepareAttachment(DatastoreWrapper.java:136)
at com.cloudant.sync.replication.PullStrategy.processOneChangesBatch(PullStrategy.java:386)
at com.cloudant.sync.replication.PullStrategy.replicate(PullStrategy.java:252)
at com.cloudant.sync.replication.PullStrategy.run(PullStrategy.java:177)
at java.lang.Thread.run(Thread.java:818)
E/PullStrategy: There was a problem downloading an attachment to the datastore, terminating replication
com.cloudant.sync.datastore.AttachmentNotSavedException: java.net.ProtocolException: unexpected end of stream
at com.cloudant.sync.datastore.PreparedAttachment.<init>(PreparedAttachment.java:90)
at com.cloudant.sync.datastore.AttachmentManager.prepareAttachment(AttachmentManager.java:213)
at com.cloudant.sync.datastore.DatastoreImpl.prepareAttachment(DatastoreImpl.java:1037)
at com.cloudant.sync.replication.DatastoreWrapper.prepareAttachment(DatastoreWrapper.java:136)
at com.cloudant.sync.replication.PullStrategy.processOneChangesBatch(PullStrategy.java:386)
at com.cloudant.sync.replication.PullStrategy.replicate(PullStrategy.java:252)
at com.cloudant.sync.replication.PullStrategy.run(PullStrategy.java:177)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.net.ProtocolException: unexpected end of stream
at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:449)
at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168)
at java.io.InputStream.read(InputStream.java:162)
at com.cloudant.sync.datastore.PreparedAttachment.<init>(PreparedAttachment.java:83)
at com.cloudant.sync.datastore.AttachmentManager.prepareAttachment(AttachmentManager.java:213)
at com.cloudant.sync.datastore.DatastoreImpl.prepareAttachment(DatastoreImpl.java:1037)
at com.cloudant.sync.replication.DatastoreWrapper.prepareAttachment(DatastoreWrapper.java:136)
at com.cloudant.sync.replication.PullStrategy.processOneChangesBatch(PullStrategy.java:386)
at com.cloudant.sync.replication.PullStrategy.replicate(PullStrategy.java:252)
at com.cloudant.sync.replication.PullStrategy.run(PullStrategy.java:177)
at java.lang.Thread.run(Thread.java:818)
请给我您的帮助。谢谢。
please give me your help. thank you.
推荐答案
问题不在于 PreparedAttachment
与基础网络。看起来服务器发送的字节数超过了 Content-Length
标头规定的字节数。这可能与您使用的服务器有关。
The problem isn't with PreparedAttachment
its with the underlying networking. It would appear that server sent more bytes than then Content-Length
header stipulated. This is probably a bug with the server you using.
这篇关于Cloudant中的PreparedAttachment中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文