java.util.ConcurrentModificationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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}
    via by Pedro Enrique,
  • 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}
    via by Pedro Enrique,
  • Some Error
    via GitHub by ghost
    ,
  • java.util.ConcurrentModificationException
    via by Unknown author,
  • We see the following exception in Status messages for LoggerContext (see attached pic lbClassicStatus.jpg) java.util.ConcurrentModificationException at java.util.Hashtable$Enumerator.next(Hashtable.java:1031) at ch.qos.logback.classic.LoggerContext.syncRemoteView(LoggerContext.java:93) at ch.qos.logback.classic.LoggerContext.putProperty(LoggerContext.java:101) at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:42) at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:48) at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130) at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:147) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:133) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:55) at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at com.excilys.ebi.utils.spring.log.logback.LogbackConfigurer.initLogging(LogbackConfigurer.java:90) at com.excilys.ebi.utils.spring.log.logback.web.LogbackWebConfigurer.initLogging(LogbackWebConfigurer.java:92) at com.excilys.ebi.utils.spring.log.logback.web.LogbackConfigListener.contextInitialized(LogbackConfigListener.java:43) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Our web application set default configuration logback.xml file in the class path so that logback will use it to configure itself during initialization. It is slightly different (only set info level) from the default basic configuration, used in case there is no such file (see attached logback.xml). The real logback.xml configuration file is outside of the web application (attached as logback-conf.xml) and we reconfigure logapp to use it with spring integration lib https://github.com/excilys/spring-log Not sure that the rest of the description will be helpful to troubleshoot the problem, but this is how we reproduce it: This is the example code: <context-param> <param-name>logbackConfigLocation</param-name> <param-value>file:${basedir}/conf/logback.xml</param-value> </context-param> <listener> <listener-class>com.excilys.ebi.utils.spring.log.logback.web.LogbackConfigListener</listener-class> </listener> After spring is loaded LogbackConfigListener class will initialize logback from the given location and reset the logger context. Code snip from LogbackConfigListener init logging below: public static void initLogging(String location) throws FileNotFoundException, JoranException { String resolvedLocation = SystemPropertyUtils.resolvePlaceholders(location); URL url = ResourceUtils.getURL(resolvedLocation); ContextSelector selector = ContextSelectorStaticBinder.getSingleton().getContextSelector(); LoggerContext loggerContext = selector.getLoggerContext(); // in the current version logback automatically configures at startup // the context, so we have to reset it loggerContext.reset(); ContextInitializer contextInitializer = new ContextInitializer(loggerContext); contextInitializer.configureByResource(url); // reset JUL // don't forget to configure the LevelChangePropagator contextListener // in the config file!!! SLF4JBridgeHandler.install(); } We sometimes receive concurrency modification exception from the logback core code. We never observe this issue if we remove default logback file from the class path as initial configuration. To prevent this exception we also delay logback configuration loading. Thank you, Svetla
    via by Svetla Arnaudova,
    • java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796) at java.util.HashMap$EntryIterator.next(HashMap.java:833) at java.util.HashMap$EntryIterator.next(HashMap.java:831) at java.util.HashMap.constructorPutAll(HashMap.java:209) at java.util.HashMap.<init>(HashMap.java:200) at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:79) at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:156) at org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(TiViewProxy.java:818) at ti.modules.titanium.ui.widget.tableview.TiTableView$1.onScrollStateChanged(TiTableView.java:306) at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3253) at android.widget.AbsListView$TwFlingRunnable.endFling(AbsListView.java:3323) at android.widget.AbsListView$TwFlingRunnable.run(AbsListView.java:3392) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3691) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) at dalvik.system.NativeStart.main(Native Method)

    Users with the same issue

    iridic
    2 times, last one,
    franky li
    1 times, last one,
    Unknown visitor1 times, last one,
    Akshay
    6 times, last one,
    Unknown visitor1 times, last one,
    13 more bugmates