多线程环境下 java.io.IOException: Mark has been invalidated.
2011-12-15 15:40
1111 查看
bitmap = BitmapFactory.decodeStream(uc.getInputStream());
12-15 15:25:47.275: W/System.err(2303): java.io.IOException: Mark has been invalidated. 12-15 15:25:47.295: W/System.err(2303): at java.io.BufferedInputStream.reset(BufferedInputStream.java:425) 12-15 15:25:47.335: W/System.err(2303): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 12-15 15:25:47.345: W/System.err(2303): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:505) 12-15 15:25:47.365: W/System.err(2303): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:566) 12-15 15:25:47.385: W/System.err(2303): at org.droid.util.view.BitmapUtils.loadBitmapFromNet(BitmapUtils.java:50) 12-15 15:25:47.395: W/System.err(2303): at org.droid.util.AsyncLoader.doInBackground(AsyncLoader.java:39) 12-15 15:25:47.405: W/System.err(2303): at android.os.AsyncTask$2.call(AsyncTask.java:216) 12-15 15:25:47.425: W/System.err(2303): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:336) 12-15 15:25:47.435: W/System.err(2303): at java.util.concurrent.FutureTask.run(FutureTask.java:168) 12-15 15:25:47.445: W/System.err(2303): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1099) 12-15 15:25:47.465: W/System.err(2303): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:592) 12-15 15:25:47.485: W/System.err(2303): at java.lang.Thread.run(Thread.java:1127)
究其原因 主要是 多个线程操作了 HttpUrlConnection 这个对象。。
解决办法 。 把 static方法改成非static的了。然后每次都重新撞见一个对象 问题解决
相关文章推荐
- 多线程环境下 java.io.IOException: Mark has been invalidated.
- 多线程环境下 java.io.IOException: Mark has been invalidated.
- 使用universal-image-loader时报异常java.io.IOException: Mark has been invalidated.
- java.io.IOException: This archive has already been finished
- Hbase java.io.IOException: The connection has to be unmanaged.
- android环境下解决java.io.IOException: Malformed ipv6异常的方法
- java.io.IOException: mark/reset not supported
- java.io.IOException: mark/reset not supported
- windows环境下springboot集成phoenix时报如下异常: java.io.IOException: Could not locate executable null\bin\winut
- java.io.IOException: mark() not supported
- java多线程运行结果写入文件错误java.io.IOException: Stream closed
- [异常-开发环境-myeclipse-ubuntu-android2.2]keytool": java.io.IOException: error=13, 权限不够
- 文件读取IO异常java.io.IOException: mark/reset not supported at java.io.InputStream.reset
- android环境下解决java.io.IOException: Malformed ipv6异常的方法
- Android开发中与服务器交互时,遇到java.io.IOException: Target host must not be null的问题
- MyEclipse启动之java.lang.RuntimeException: No application id has been found.
- IOException while loading persisted sessions: java.io.EOFExc
- java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
- java.io.IOException: No FileSystem for scheme: hdfs
- java.io.IOException: No FileSystem for scheme: hdfs