Comments (14)
Hi sergej, I re-deployed a new snapshot for this issue. Just now. Can you try it ?
Although this bug is quite valuable for us, wouldn't you better served by a SpiceList btw ?
Thanks,
Stéphane
from robospice.
The snapshot seems to be working, at least I couldn't get it to crash anymore. I'm not using SpiceList because I actually need to do two-step fetching, first fetch additional info for each list item, then fetch an image, and SpiceList doesn't give me that flexibility, it's useful only for loading images.
from robospice.
I had this exception, too I think with many listitems (actually in a GridView). The difference is, I am using the spicelist-module. I don't have the stacktrace around, but I will retest it with this version and report again here if it reoccurs. Thanks for the try to fix it.
from robospice.
Oh, one important thing I remember, The related HashMap-iterating code was about notifying the OctoImageRequestListener-instances on the main UI-thread, so the app crashed because of this.
The exception occured in a for-loop for the generic Map holding the listener-instances.
from robospice.
Stinger, you can either compile the current master branch or use the
snapshot repo of sonatype.
Release 1.4.1 should be out by the end of the month.
Stéphane
2013/3/6 StingerAJ [email protected]
Oh, one important thing I remember, The related HashMap-iterating code was
about notifying the OctoImageRequestListener-instances on the main
UI-thread, so the app crashed because of this.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-14486385
.
Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................
from robospice.
Got the same exception in ProgressRunnable.run (using 1.4.1-SNAPSHOT):
FATAL EXCEPTION: main
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:792)
at java.util.HashMap$KeyIterator.next(HashMap.java:819)
at com.octo.android.robospice.request.RequestProcessor$ProgressRunnable.run(RequestProcessor.java:402)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
from robospice.
I released a new snapshot (both sonatype and our own repo on github) to get
the line numbers right. Would you mind logging a new stack trace ?
Is there any way I can reproduce the problem ? / Write a test for TDD ?
(all jars are gonna finish uploading within 10 mn after this mail is sent)
Stéphane
2013/3/11 Sergej Ko¹èejev [email protected]
Got the same exception in ProgressRunnable.run (using 1.4.1-SNAPSHOT):
FATAL EXCEPTION: main
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:792)
at java.util.HashMap$KeyIterator.next(HashMap.java:819)
at
com.octo.android.robospice.request.RequestProcessor$ProgressRunnable.run(RequestProcessor.java:402)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-14718239
.
Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................
from robospice.
The exception occurred in a different location this time, not sure if it was clear from my comment. And it occurred only once so far so I don't know if I will be able to provide a unit test. I'll let you know if it occurs again with the new snapshot.
from robospice.
I got the same problem when I register and unregister some listeners during a spice request execution.
from robospice.
Hi to all people who wanna participate on this issue.
We need :
- the version of RoboSpice you tried (actually we got a wonderful
snapshot repo on sonatype and our own snapshot repo on github - repository
branch of RoboSpice - for ant users) - ideally, a test that we can run to find the problem and correct it.
- if you don't have a test, a simple app / procedure to reproduce the
issue.
Otherwise, we sincerly can't do much.
Stéphane
2013/3/14 gcacace [email protected]
I got the same problem when I register and unregister some listeners
during a spice request execution.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-14896913
.
Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................
from robospice.
I see that in RequestProcessor.java there are concurrent accesses to the Map "mapRequestToRequestListener", outside synchronized blocks, so the ConcurrentModificationException happens when the map is iterating and some concurrent task is putting or removing something inside the map. To fix this bug I think it's necessary to add some synchronized blocks or to use a Synchronized Map. Anyway I'm using the latest RoboSpice version 1.4.1-SNAPSHOT.
from robospice.
Would you like to submit a pull request to indicate which accesses are
possibly dangerous and patch them ?
S.
2013/3/19 gcacace [email protected]
I see that in RequestProcessor.java there are concurrent accesses to the
Map "mapRequestToRequestListener", outside synchronized blocks, so the
ConcurrentModificationException happens when the map is iterating and some
concurrent task is putting or removing something inside the map. To fix
this bug I think it's necessary to add some synchronized blocks or to use a
Synchronized Map. Anyway I'm using the latest RoboSpice version
1.4.1-SNAPSHOT.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-15110409
.
Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................
from robospice.
I just had a similar exception trying to load images in a gridview with the ui-spicelist extension. I also modified BitmapRequest to add a cacheduration-property which is in my modification checked by the SpiceArrayAdapter as that doesn't use the standard cache-logic.
Here is the stacktrace of the exception:
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:792)
at java.util.HashMap$KeyIterator.next(HashMap.java:819)
at com.octo.android.robospice.request.RequestProcessor$ResultRunnable.run(RequestProcessor.java:435)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
from robospice.
FYI, I somewhat fixed the exception by modifying the RequestProcessor to use a ConcurrentHashMap and a self-built ConcurrentHashSet similar to the CHM.
This prevents the exception, but not all images are being loaded and displayed, due to some listeners not being registered correctly, I think.
About the cache-logic in SpiceArrayAdapter and the BitmapRequest:
I tested my modification with my tablet in airplane-mode and with cacheDuration set to ALWAYS_EXPIRED, but some images are loaded from the cache disregarding the setting.
So I stashed this "fix" and the mod of the BitmapRequest cache-logic away in hope that you will find a better solution.
If you want, I can give you a patchfile or a pull request with my modifications so you get an impression what might be wrong with my code.
from robospice.
Related Issues (20)
- proguard warning HOT 1
- Getting a Callback after Fragment has been detached
- Retrofit throwing exceptions for every single call HOT 2
- Caching skipped if List sub-type is involved HOT 2
- Is This library still maintained ? HOT 5
- robospice usecase: external rest-service returns null
- Could not find class 'com.octo.android.robospice.persistence.ObjectPersister' HOT 4
- Best Practice for design to connect to multiple services
- Robospice and binary post requests? HOT 5
- response headers missing? HOT 4
- removeDataFromCache(Class clazzm, Object cacheKey) not working on 1.4.13
- BigBinaryRequest with customized headers/interceptors.
- Android O background service limitations HOT 5
- Download a file with query params HOT 1
- java.lang.NoSuchMethodError: No virtual method No virtual method open(Ljava/net/URL;)Ljava/net/HttpURLConnection; HOT 10
- Build failed on windows (android studio2.23 @win7 64-bit), but no problem on Mac. HOT 4
- RoboSpice within the MVVM pattern HOT 2
- How to log api response time at common place? HOT 1
- Android O (8.1.0) : invalid channel for service notification HOT 8
- Xmlrpc Request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robospice.