GithubHelp home page GithubHelp logo

Comments (14)

stephanenicolas avatar stephanenicolas commented on August 27, 2024

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.

sergej-koscejev avatar sergej-koscejev commented on August 27, 2024

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.

StingerAJ avatar StingerAJ commented on August 27, 2024

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.

StingerAJ avatar StingerAJ commented on August 27, 2024

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.

stephanenicolas avatar stephanenicolas commented on August 27, 2024

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.

sergej-koscejev avatar sergej-koscejev commented on August 27, 2024

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.

stephanenicolas avatar stephanenicolas commented on August 27, 2024

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.

sergej-koscejev avatar sergej-koscejev commented on August 27, 2024

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.

gcacace avatar gcacace commented on August 27, 2024

I got the same problem when I register and unregister some listeners during a spice request execution.

from robospice.

stephanenicolas avatar stephanenicolas commented on August 27, 2024

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.

gcacace avatar gcacace commented on August 27, 2024

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.

stephanenicolas avatar stephanenicolas commented on August 27, 2024

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.

StingerAJ avatar StingerAJ commented on August 27, 2024

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.

StingerAJ avatar StingerAJ commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.