发布于2025-01-18 21:48 阅读(598) 评论(0) 点赞(12) 收藏(5)
我正在尝试从我正在创建的 Android 应用程序内部连接到我服务器上的网页,但由于某种原因,它似乎在一行上失败了。
Java 代码:
URL url = new URL("http://redsquirrelsoftware.co.uk/android/assignments/androidlogin.php");
HttpURLConnection hConnection = (HttpURLConnection)url.openConnection();
HttpURLConnection.setFollowRedirects(true);
hConnection.setDoOutput(true);
hConnection.setRequestMethod("POST");
// ERROR OCCURS ON NEXT LINE
PrintStream ps = new PrintStream(hConnection.getOutputStream());
ps.print("email=" + LoginActivity.email + "&" + "pword=" + LoginActivity.password);
ps.close();
hConnection.connect();
LogCat 响应给了我一个 IllegalStateException - 无法访问应用程序密钥,我以前从未见过,也不知道如何修复它。它还提到了 TimerTask.run(),而我的任何代码中都没有这个 - 猜猜它是 Android 自己的一些代码?
01-08 21:28:55.300: E/MtpService(17770): TimerTask.run(): mReason =1
01-08 21:28:57.990: E/InputDispatcher(165): channel '41621cb0 uk.co.redsquirrelsoftware.assignmenttracker/uk.co.redsquirrelsoftware.assignmenttracker.LoginActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-08 21:29:01.870: E/GetJar SDK(17935): PackageMonitor: doOnReceive(): failed
01-08 21:29:01.870: E/GetJar SDK(17935): java.lang.IllegalStateException: Unable to access the application key
01-08 21:29:01.870: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor.doOnReceive(PackageMonitor.java:113)
01-08 21:29:01.870: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor.access$000(PackageMonitor.java:62)
01-08 21:29:01.870: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor$1.run(PackageMonitor.java:87)
01-08 21:29:01.870: E/GetJar SDK(17935): at java.lang.Thread.run(Thread.java:856)
01-08 21:29:02.230: E/GetJar SDK(17918): PackageMonitor: doOnReceive(): failed
01-08 21:29:02.230: E/GetJar SDK(17918): java.lang.IllegalStateException: Unable to access the application key
01-08 21:29:02.230: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor.doOnReceive(PackageMonitor.java:117)
01-08 21:29:02.230: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor.access$000(PackageMonitor.java:59)
01-08 21:29:02.230: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor$1.run(PackageMonitor.java:84)
01-08 21:29:02.230: E/GetJar SDK(17918): at java.lang.Thread.run(Thread.java:856)
01-08 21:29:02.470: E/GetJar SDK(17918): PackageMonitor: doOnReceive(): failed
01-08 21:29:02.470: E/GetJar SDK(17918): java.lang.IllegalStateException: Unable to access the application key
01-08 21:29:02.470: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor.doOnReceive(PackageMonitor.java:117)
01-08 21:29:02.470: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor.access$000(PackageMonitor.java:59)
01-08 21:29:02.470: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor$1.run(PackageMonitor.java:84)
01-08 21:29:02.470: E/GetJar SDK(17918): at java.lang.Thread.run(Thread.java:856)
01-08 21:29:02.500: E/GetJar SDK(17935): PackageMonitor: doOnReceive(): failed
01-08 21:29:02.500: E/GetJar SDK(17935): java.lang.IllegalStateException: Unable to access the application key
01-08 21:29:02.500: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor.doOnReceive(PackageMonitor.java:113)
01-08 21:29:02.500: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor.access$000(PackageMonitor.java:62)
01-08 21:29:02.500: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor$1.run(PackageMonitor.java:87)
01-08 21:29:02.500: E/GetJar SDK(17935): at java.lang.Thread.run(Thread.java:856)
01-08 21:29:17.530: E/dalvikvm(18081): Could not find class 'com.google.common.collect.HashMultiset', referenced from method com.fasterxml.jackson.datatype.guava.GuavaDeserializers.findCollectionDeserializer
01-08 21:29:17.540: E/dalvikvm(18081): Could not find class 'com.google.common.collect.EnumBiMap', referenced from method com.fasterxml.jackson.datatype.guava.GuavaDeserializers.findMapDeserializer
01-08 21:29:17.540: E/dalvikvm(18081): Could not find class 'com.google.common.collect.ImmutableSetMultimap', referenced from method com.fasterxml.jackson.datatype.guava.GuavaDeserializers.findMapLikeDeserializer
01-08 21:29:17.540: E/dalvikvm(18081): Could not find class 'com.google.common.collect.Table', referenced from method com.fasterxml.jackson.datatype.guava.GuavaDeserializers.findMapLikeDeserializer
关于如何修复它,您有什么建议吗?谢谢
我认为日志中的相关行是:
01-08 21:28:57.990:E/InputDispatcher(165):通道“41621cb0 uk.co.redsquirrelsoftware.assignmenttracker/uk.co.redsquirrelsoftware.assignmenttracker.LoginActivity(服务器)”〜通道已不可恢复地损坏,将被处置!
请参阅该问题的可接受答案:
作者:黑洞官方问答小能手
链接:http://www.javaheidong.com/blog/article/695235/0806da7570b38ec30af5/
来源:java黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
---无人问津也好,技不如人也罢,你都要试着安静下来,去做自己该做的事,而不是让内心的烦躁、焦虑,坏掉你本来就不多的热情和定力
Copyright © 2018-2021 java黑洞网 All Rights Reserved 版权所有,并保留所有权利。京ICP备18063182号-2
投诉与举报,广告合作请联系vgs_info@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!