我最近编写了一个具有一些Internet连接的应用程序。所有进程在模拟器中运行良好,但在Android Studio上,它会抛出一个java.net.ProtocolException:意外的流结束
,并带有以下堆栈跟踪。
1-13 02:12:53.271 6346-6357/com.my.medi I/zygote: NativeAlloc concurrent copying GC freed 17517(1179KB) AllocSpace objects, 95(4MB) LOS objects, 49% free, 6MB/12MB, paused 4.142ms total 928.991ms
01-13 02:13:03.749 6346-6363/com.my.medi I/System.out: New alert generated: Message - No new updates found
01-13 02:13:28.872 6346-6368/com.my.medi D/Medi: [Network Thread] 0:22:30,491 - Exception: java.net.ProtocolException - unexpected end of stream
01-13 02:13:28.884 6346-6368/com.my.medi W/System.err: java.net.ProtocolException: unexpected end of stream
01-13 02:13:28.917 6346-6368/com.my.medi W/System.err: at com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.read(Http1xStream.java:396)
01-13 02:13:28.919 6346-6368/com.my.medi W/System.err: at com.android.okhttp.okio.RealBufferedSource$1.read(RealBufferedSource.java:371)
01-13 02:13:28.921 6346-6368/com.my.medi W/System.err: at com.android.tools.profiler.support.network.HttpTracker$InputStreamTracker.read(HttpTracker.java:103)
01-13 02:13:28.923 6346-6368/com.my.medi W/System.err: at com.codename1.io.BufferedInputStream.read1(BufferedInputStream.java:338)
01-13 02:13:28.930 6346-6368/com.my.medi W/System.err: at com.codename1.io.BufferedInputStream.read(BufferedInputStream.java:445)
01-13 02:13:28.939 6346-6363/com.my.medi D/Medi: [EDT] 0:22:30,551 - Exception: java.lang.NullPointerException - Attempt to get length of null array
01-13 02:13:28.942 6346-6368/com.my.medi W/System.err: at com.codename1.io.BufferedInputStream.read(BufferedInputStream.java:668)
01-13 02:13:28.944 6346-6368/com.my.medi W/System.err: at com.codename1.io.Util.copyNoClose(Util.java:121)
01-13 02:13:28.948 6346-6368/com.my.medi W/System.err: at com.codename1.io.Util.copy(Util.java:135)
01-13 02:13:28.950 6346-6368/com.my.medi W/System.err: at com.codename1.io.Util.copy(Util.java:106)
01-13 02:13:28.956 6346-6368/com.my.medi W/System.err: at com.codename1.io.Util.readInputStream(Util.java:184)
01-13 02:13:28.958 6346-6368/com.my.medi W/System.err: at com.codename1.io.ConnectionRequest.readResponse(ConnectionRequest.java:1300)
01-13 02:13:28.968 6346-6368/com.my.medi W/System.err: at com.codename1.io.gzip.GZConnectionRequest.readUnzipedResponse(GZConnectionRequest.java:76)
01-13 02:13:28.973 6346-6368/com.my.medi W/System.err: at com.codename1.io.gzip.GZConnectionRequest.readResponse(GZConnectionRequest.java:67)
01-13 02:13:28.977 6346-6368/com.my.medi W/System.err: at com.codename1.io.ConnectionRequest.performOperation(ConnectionRequest.java:797)
01-13 02:13:28.979 6346-6368/com.my.medi W/System.err: at com.codename1.io.NetworkManager$NetworkThread.run(NetworkManager.java:282)
01-13 02:13:28.987 6346-6368/com.my.medi W/System.err: at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
01-13 02:13:28.990 6346-6368/com.my.medi W/System.err: at java.lang.Thread.run(Thread.java:764)
01-13 02:13:28.991 6346-6363/com.my.medi W/System.err: java.lang.NullPointerException: Attempt to get length of null array
01-13 02:13:29.002 6346-6363/com.my.medi W/System.err: at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
01-13 02:13:29.004 6346-6363/com.my.medi W/System.err: at com.codename1.io.rest.RequestBuilder.getAsJsonMap(RequestBuilder.java:336)
01-13 02:13:29.007 6346-6363/com.my.medi W/System.err: at com.my.medi.Server.updateNews(Unknown Source:16)
01-13 02:13:29.010 6346-6363/com.my.medi W/System.err: at com.wefeel.entry.sqlmodel.NewsQuery.updateNews(Unknown Source:0)
01-13 02:13:29.013 6346-6363/com.my.medi W/System.err: at com.UI.NewsList.fetchNews(Unknown Source:6)
01-13 02:13:29.017 6346-6363/com.my.medi W/System.err: at com.UI.NewsList.lambda$new$2(Unknown Source:0)
01-13 02:13:29.019 6346-6363/com.my.medi W/System.err: at com.UI.NewsList$$Lambda$2.run(Unknown Source:2)
01-13 02:13:29.021 6346-6363/com.my.medi W/System.err: at com.codename1.ui.Component$1.run(Component.java:2076)
01-13 02:13:29.023 6346-6363/com.my.medi W/System.err: at com.codename1.ui.Display.processSerialCalls(Display.java:1116)
01-13 02:13:29.026 6346-6363/com.my.medi W/System.err: at com.codename1.ui.Display.edtLoopImpl(Display.java:1060)
01-13 02:13:29.028 6346-6363/com.my.medi W/System.err: at com.codename1.ui.Display.mainEDTLoop(Display.java:948)
01-13 02:13:29.030 6346-6363/com.my.medi W/System.err: at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
01-13 02:13:29.032 6346-6363/com.my.medi W/System.err: at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
01-13 02:13:29.034 6346-6363/com.my.medi W/System.err: at java.lang.Thread.run(Thread.java:764)
01-13 02:13:29.162 6346-6363/com.my.medi I/System.out: New alert generated: Message - java.lang.NullPointerException: Attempt to get length of null array
01-13 02:13:29.196 6346-6363/com.my.medi W/System.err: java.lang.NullPointerException: Attempt to get length of null array
01-13 02:13:29.199 6346-6363/com.my.medi W/System.err: at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
01-13 02:13:29.201 6346-6363/com.my.medi W/System.err: at com.codename1.io.rest.RequestBuilder.getAsJsonMap(RequestBuilder.java:336)
01-13 02:13:29.205 6346-6363/com.my.medi W/System.err: at com.my.medi.Server.updateNews(Unknown Source:16)
01-13 02:13:29.208 6346-6363/com.my.medi W/System.err: at com.wefeel.entry.sqlmodel.NewsQuery.updateNews(Unknown Source:0)
01-13 02:13:29.210 6346-6363/com.my.medi W/System.err: at com.UI.NewsList.fetchNews(Unknown Source:6)
01-13 02:13:29.215 6346-6363/com.my.medi W/System.err: at com.UI.NewsList.lambda$new$2(Unknown Source:0)
01-13 02:13:29.217 6346-6363/com.my.medi W/System.err: at com.UI.NewsList$$Lambda$2.run(Unknown Source:2)
01-13 02:13:29.218 6346-6363/com.my.medi W/System.err: at com.codename1.ui.Component$1.run(Component.java:2076)
01-13 02:13:29.256 6346-6363/com.my.medi W/System.err: at com.codename1.ui.Display.processSerialCalls(Display.java:1116)
01-13 02:13:29.258 6346-6363/com.my.medi W/System.err: at com.codename1.ui.Display.edtLoopImpl(Display.java:1060)
01-13 02:13:29.266 6346-6363/com.my.medi W/System.err: at com.codename1.ui.Display.mainEDTLoop(Display.java:948)
01-13 02:13:29.269 6346-6363/com.my.medi W/System.err: at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
01-13 02:13:29.271 6346-6363/com.my.medi W/System.err: at com.codename1.impl.CodenameOneThread$1.run(CodenameOneThread.java:60)
01-13 02:13:29.277 6346-6363/com.my.medi W/System.err: at java.lang.Thread.run(Thread.java:764)
01-13 02:13:30.698 6346-6363/com.my.medi V/RenderScript: User-backed allocation failed stride requirement, falling back to separate allocation
01-13 02:13:30.776 6346-6363/com.my.medi I/chatty: uid=10082(com.my.medi) EDT identical 2 lines
01-13 02:13:30.778 6346-6363/com.my.medi V/RenderScript: User-backed allocation failed stride requirement, falling back to separate allocation
01-13 02:13:30.897 6346-6363/com.my.medi V/RenderScript: User-backed allocation failed stride requirement, falling back to separate allocation
01-13 02:13:30.982 6346-6363/com.my.medi I/chatty: uid=10082(com.my.medi) EDT identical 4 lines
01-13 02:13:30.983 6346-6363/com.my.medi V/RenderScript: User-backed allocation failed stride requirement, falling back to separate allocation
快速的网络搜索表明,这个问题可能与回复标题有关,但我不确定为什么/如何防止这个错误。
如果您的服务器设置了内容长度
标头并返回不同的字节数,则 Android 将失败。解决方案是将内容长度
标头设置为 -1 或实际正确的字节数。
这一条给出: 这个: 我想做的是避免为所有测试编写完整的jsons,如果我可以跳过所有“”和{},将会更快。我的方法正确吗?
问题内容: 在我的JMeter测试中,如果有任何错误,我想触发HTTP请求以在系统上发布消息,以进一步关注。我在这里可以做什么?邮件可视化工具可以很好地通过电子邮件报告错误。我想做同样的事情,但是要通过HTTP请求。我正在使用jmeter 3.2。 问题答案: 您可以执行以下操作: 在HTTP Request采样器之后添加If Controller,并将以下代码放入“条件”区域: 将SMTP Sa
在我的Android应用程序中,我正在集成Facebook SDK,以在其中包含shareDialog。共享对话框完全打开,显示了预填充的详细信息。当我点击sharedialog屏幕右上角的SHARE时,我在logcat和Toast中发现了下面提到的错误。请让我知道我的配置需要修改的地方。
我正在研究一套Selenium WebDriver(不是Selenium RC,也不使用Selenium-Server)测试,这些测试通过对mstest的命令行调用执行。我将它们分解为我们计划测试的每个浏览器的测试类(目前是Chrome、Firefox和IE9),每个测试类都有一个启动方法,它登录到测试中的系统,然后执行请求的测试,还有一个拆分方法,它使用webdriver.quit()关闭浏览器
Strip build/build/intermediates/archiveintermediates/main/installationbuildproductslocation/applications/main.app/main cd/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/t/build9030811877552061486xxx/di
我正在尝试通过Livy连接到一个kerberized hadoop集群以执行Spark代码。请求调用im制作如下所示。 此调用失败,出现以下错误 GSSException:未提供有效凭据(机制级别:找不到任何Kerberos凭据) 如果有任何帮助,我们将不胜感激。