B4J Question java.util.ConcurrentModificationException

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I have a B4J program that (using thread library) starts threads to read MP3 files and display the information in a TableView.

NOT currently using SQL in the program (which this error seems to imply)

I feel this has to be in either where I am inserting into the TableView or using a global list.

Can't use the debugger because of using the threading library.


java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966)
at java.util.LinkedList$ListItr.next(LinkedList.java:888)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:132)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:84)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1072)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)

Sometimes instead of the above error I get:

java.lang.NullPointerException
at java.util.LinkedList$ListItr.next(LinkedList.java:893)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:132)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:84)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1072)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
 
Last edited:

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I pick a directory (which can contain sub directories) of mp3 files.

I want to be able to fire of reading of multiple mp3 files at the same time


PS: Just replace threading library with CallSubDelay and all is Good Now

Thanks
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…