java.util.ConcurrentModificationException

Appcelerator JIRA | Pedro Enrique | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    h3. Description The following code will make the app crash after scrolling all the way to the bottom and back up. Sometimes it crashes earlier. Another thing that happens is a JS error pops up as shown in this image: http://f.cl.ly/items/3e3i103A0W0y3S3Z3S1B/image001.png All this happened after the fix for bug TIMOB-13055 {code} var win = Ti.UI.createWindow({ backgroundColor: '#ffffff' }); var tableData = []; var x = 0; for(var i = 0; i < 10; i++) { // Create 10 sections var section = Ti.UI.createTableViewSection({ font: { fontSize: '14dp' }, headerTitle: 'Pretty Section #' + (i+1), color: 'white' }); // Create 10 rows and add them to the section for(var o = 0; o < 10; o++) { var avatar = Ti.UI.createImageView({ image: 'KS_nav_ui.png', width: '64dp', height: '64dp', left: '0dp', top: '0dp' }); x++; var title = Ti.UI.createLabel({ left: '70dp', top: '5dp', height: Ti.UI.SIZE, font: { fontSize: '18dp' }, color: 'black', text: 'Row number is ' + (o+1) }); var subtitle = Ti.UI.createLabel({ left: '70dp', top: '30dp', height: Ti.UI.SIZE, font: { fontSize: '14dp' }, color: 'black', text: 'Section is ' + (i+1) }); var row = Ti.UI.createTableViewRow({ height: '64dp', className: 'choppy_tableview' }); row.add(avatar); row.add(title); row.add(subtitle); section.add(row); } tableData.push(section); } // Create the table view var table = Ti.UI.createTableView({ data: tableData }); table.addEventListener('click', function(){ }); table.addEventListener('scroll', function(){ }); win.add(table); win.open(); {code} h3. Stack trace: {code} 04-04 14:09:03.784: E/TiApplication(10959): (main) [11968,11968] Sending event: exception on thread: main msg:java.util.ConcurrentModificationException; Titanium 3.1.0,2013/04/02 15:41,1b76dea 04-04 14:09:03.784: E/TiApplication(10959): java.util.ConcurrentModificationException 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:833) 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:831) 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap.constructorPutAll(HashMap.java:209) 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap.<init>(HashMap.java:200) 04-04 14:09:03.784: E/TiApplication(10959): at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79) 04-04 14:09:03.784: E/TiApplication(10959): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156) 04-04 14:09:03.784: E/TiApplication(10959): at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818) 04-04 14:09:03.784: E/TiApplication(10959): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) 04-04 14:09:03.784: E/TiApplication(10959): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) 04-04 14:09:03.784: E/TiApplication(10959): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) 04-04 14:09:03.784: E/TiApplication(10959): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) 04-04 14:09:03.784: E/TiApplication(10959): at android.os.Handler.handleCallback(Handler.java:587) 04-04 14:09:03.784: E/TiApplication(10959): at android.os.Handler.dispatchMessage(Handler.java:92) 04-04 14:09:03.784: E/TiApplication(10959): at android.os.Looper.loop(Looper.java:130) 04-04 14:09:03.784: E/TiApplication(10959): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-04 14:09:03.784: E/TiApplication(10959): at java.lang.reflect.Method.invokeNative(Native Method) 04-04 14:09:03.784: E/TiApplication(10959): at java.lang.reflect.Method.invoke(Method.java:507) 04-04 14:09:03.784: E/TiApplication(10959): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-04 14:09:03.784: E/TiApplication(10959): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-04 14:09:03.784: E/TiApplication(10959): at dalvik.system.NativeStart.main(Native Method) 04-04 14:09:03.854: E/(134): Dumpstate > /data/log/dumpstate_app_error 04-04 14:09:03.854: E/AndroidRuntime(10959): FATAL EXCEPTION: main 04-04 14:09:03.854: E/AndroidRuntime(10959): java.util.ConcurrentModificationException 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:833) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:831) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap.constructorPutAll(HashMap.java:209) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap.<init>(HashMap.java:200) 04-04 14:09:03.854: E/AndroidRuntime(10959): at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79) 04-04 14:09:03.854: E/AndroidRuntime(10959): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156) 04-04 14:09:03.854: E/AndroidRuntime(10959): at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818) 04-04 14:09:03.854: E/AndroidRuntime(10959): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Handler.handleCallback(Handler.java:587) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Handler.dispatchMessage(Handler.java:92) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Looper.loop(Looper.java:130) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.lang.reflect.Method.invokeNative(Native Method) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.lang.reflect.Method.invoke(Method.java:507) 04-04 14:09:03.854: E/AndroidRuntime(10959): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-04 14:09:03.854: E/AndroidRuntime(10959): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-04 14:09:03.854: E/AndroidRuntime(10959): at dalvik.system.NativeStart.main(Native Method) {code}

    Appcelerator JIRA | 4 years ago | Pedro Enrique
    java.util.ConcurrentModificationException
  2. 0

    h3. Description The following code will make the app crash after scrolling all the way to the bottom and back up. Sometimes it crashes earlier. Another thing that happens is a JS error pops up as shown in this image: http://f.cl.ly/items/3e3i103A0W0y3S3Z3S1B/image001.png All this happened after the fix for bug TIMOB-13055 {code} var win = Ti.UI.createWindow({ backgroundColor: '#ffffff' }); var tableData = []; var x = 0; for(var i = 0; i < 10; i++) { // Create 10 sections var section = Ti.UI.createTableViewSection({ font: { fontSize: '14dp' }, headerTitle: 'Pretty Section #' + (i+1), color: 'white' }); // Create 10 rows and add them to the section for(var o = 0; o < 10; o++) { var avatar = Ti.UI.createImageView({ image: 'KS_nav_ui.png', width: '64dp', height: '64dp', left: '0dp', top: '0dp' }); x++; var title = Ti.UI.createLabel({ left: '70dp', top: '5dp', height: Ti.UI.SIZE, font: { fontSize: '18dp' }, color: 'black', text: 'Row number is ' + (o+1) }); var subtitle = Ti.UI.createLabel({ left: '70dp', top: '30dp', height: Ti.UI.SIZE, font: { fontSize: '14dp' }, color: 'black', text: 'Section is ' + (i+1) }); var row = Ti.UI.createTableViewRow({ height: '64dp', className: 'choppy_tableview' }); row.add(avatar); row.add(title); row.add(subtitle); section.add(row); } tableData.push(section); } // Create the table view var table = Ti.UI.createTableView({ data: tableData }); table.addEventListener('click', function(){ }); table.addEventListener('scroll', function(){ }); win.add(table); win.open(); {code} h3. Stack trace: {code} 04-04 14:09:03.784: E/TiApplication(10959): (main) [11968,11968] Sending event: exception on thread: main msg:java.util.ConcurrentModificationException; Titanium 3.1.0,2013/04/02 15:41,1b76dea 04-04 14:09:03.784: E/TiApplication(10959): java.util.ConcurrentModificationException 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:833) 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:831) 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap.constructorPutAll(HashMap.java:209) 04-04 14:09:03.784: E/TiApplication(10959): at java.util.HashMap.<init>(HashMap.java:200) 04-04 14:09:03.784: E/TiApplication(10959): at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79) 04-04 14:09:03.784: E/TiApplication(10959): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156) 04-04 14:09:03.784: E/TiApplication(10959): at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818) 04-04 14:09:03.784: E/TiApplication(10959): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) 04-04 14:09:03.784: E/TiApplication(10959): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) 04-04 14:09:03.784: E/TiApplication(10959): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) 04-04 14:09:03.784: E/TiApplication(10959): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) 04-04 14:09:03.784: E/TiApplication(10959): at android.os.Handler.handleCallback(Handler.java:587) 04-04 14:09:03.784: E/TiApplication(10959): at android.os.Handler.dispatchMessage(Handler.java:92) 04-04 14:09:03.784: E/TiApplication(10959): at android.os.Looper.loop(Looper.java:130) 04-04 14:09:03.784: E/TiApplication(10959): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-04 14:09:03.784: E/TiApplication(10959): at java.lang.reflect.Method.invokeNative(Native Method) 04-04 14:09:03.784: E/TiApplication(10959): at java.lang.reflect.Method.invoke(Method.java:507) 04-04 14:09:03.784: E/TiApplication(10959): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-04 14:09:03.784: E/TiApplication(10959): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-04 14:09:03.784: E/TiApplication(10959): at dalvik.system.NativeStart.main(Native Method) 04-04 14:09:03.854: E/(134): Dumpstate > /data/log/dumpstate_app_error 04-04 14:09:03.854: E/AndroidRuntime(10959): FATAL EXCEPTION: main 04-04 14:09:03.854: E/AndroidRuntime(10959): java.util.ConcurrentModificationException 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:833) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap$EntryIterator.next(HashMap.java:831) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap.constructorPutAll(HashMap.java:209) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.util.HashMap.<init>(HashMap.java:200) 04-04 14:09:03.854: E/AndroidRuntime(10959): at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79) 04-04 14:09:03.854: E/AndroidRuntime(10959): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156) 04-04 14:09:03.854: E/AndroidRuntime(10959): at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818) 04-04 14:09:03.854: E/AndroidRuntime(10959): at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Handler.handleCallback(Handler.java:587) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Handler.dispatchMessage(Handler.java:92) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.os.Looper.loop(Looper.java:130) 04-04 14:09:03.854: E/AndroidRuntime(10959): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.lang.reflect.Method.invokeNative(Native Method) 04-04 14:09:03.854: E/AndroidRuntime(10959): at java.lang.reflect.Method.invoke(Method.java:507) 04-04 14:09:03.854: E/AndroidRuntime(10959): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-04 14:09:03.854: E/AndroidRuntime(10959): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-04 14:09:03.854: E/AndroidRuntime(10959): at dalvik.system.NativeStart.main(Native Method) {code}

    Appcelerator JIRA | 4 years ago | Pedro Enrique
    java.util.ConcurrentModificationException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Some Error

    GitHub | 1 year ago | ghost
    java.util.ConcurrentModificationException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.ConcurrentModificationException

      No message provided

      at java.util.HashMap$HashIterator.nextEntry()
    2. Java RT
      HashMap.<init>
      1. java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
      2. java.util.HashMap$EntryIterator.next(HashMap.java:833)
      3. java.util.HashMap$EntryIterator.next(HashMap.java:831)
      4. java.util.HashMap.constructorPutAll(HashMap.java:209)
      5. java.util.HashMap.<init>(HashMap.java:200)
      5 frames
    3. org.appcelerator.kroll
      KrollDict.<init>
      1. org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79)
      1 frame
    4. ti.modules.titanium
      TableViewProxy.fireEvent
      1. ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156)
      1 frame
    5. org.appcelerator.titanium
      TiViewProxy.fireEvent
      1. org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818)
      1 frame
    6. ti.modules.titanium
      TiTableView$1.onScrollStateChanged
      1. ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306)
      1 frame
    7. Android Platform
      ActivityThread.main
      1. android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253)
      2. android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323)
      3. android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392)
      4. android.os.Handler.handleCallback(Handler.java:587)
      5. android.os.Handler.dispatchMessage(Handler.java:92)
      6. android.os.Looper.loop(Looper.java:130)
      7. android.app.ActivityThread.main(ActivityThread.java:3691)
      7 frames
    8. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:507)
      2 frames
    9. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
      2 frames
    10. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame