我的生产 android 应用程序抛出了这个异常。当我分析 crittercism 时,我注意到我的许多异步任务都没有完成。他们挂在
ClientSession.java:361
responseMessage = (AMessageStrategy) objectInputStream.readObject();
和
ClientSession.java:321
objectInputStream = new ObjectInputStream(new BufferedInputStream(inputStream));
.
对 SO 做了一些研究,发现了这个链接。但没有发现任何将 RejectedExecution 与挂起问题联系起来的 SO 问题。因此这个问题。
org.apache.harmony.luni.platform.OSNetworkSystem.read(Native Method)
dalvik.system.BlockGuard$WrappedNetworkSystem.read(BlockGuard.java:273)
org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:461)
org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:85)
org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:65)
java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:140)
java.io.BufferedInputStream.read(BufferedInputStream.java:324)
java.io.DataInputStream.readToBuff(DataInputStream.java:159)
java.io.DataInputStream.readShort(DataInputStream.java:375)
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2365)
java.io.ObjectInputStream.<init>(ObjectInputStream.java:433)
com.mcruiseon.common.communication.ClientSession$SendQueue.<init>(ClientSession.java:321)
org.apache.harmony.luni.platform.OSNetworkSystem.read(Native Method)
dalvik.system.BlockGuard$WrappedNetworkSystem.read(BlockGuard.java:273)
org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:461)
org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:85)
org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:65)
java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:140)
java.io.BufferedInputStream.read(BufferedInputStream.java:225)
java.io.FilterInputStream.read(FilterInputStream.java:115)
java.io.ObjectInputStream.checkReadPrimitiveTypes(ObjectInputStream.java:466)
java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:899)
java.io.ObjectInputStream.readObject(ObjectInputStream.java:2262)
java.io.ObjectInputStream.readObject(ObjectInputStream.java:2217)
com.mcruiseon.common.communication.ClientSession$SendQueue.run(ClientSession.java:361)
我有
- 在输出流创建后刷新
- 在输入流之前创建输出流
- 写入后立即刷新
我还是明白了,这是一个随机错误,发生在产品投入生产 2 个月后。任何想法的人?