URGENT:: Why do I get this thread exception in Java?

I have a code in Java which creates a GUI and this GUI runs a command line tool and it processes the output to visualize the results.

While doing that I create a work thread and do the other CLI operations on this thread so that the GUI does not freeze during this time.

However, I sometimes get the following exception:

Exception in thread "Thread-1" java.util.ConcurrentModificationException
        at java.util.ArrayList.writeObject(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
        at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
        at java.io.ObjectOutputStream.writeObject0(Unknown Source)
        at java.io.ObjectOutputStream.writeObject(Unknown Source)
        at com.something.CSFilteringCheckBoxes.s
        at com.something.RunPerl.runMtcheck(RunP
        at com.something.ToolBarListener$1.run(T
        at java.lang.Thread.run(Unknown Source)

Open in new window

Why do I sometimes get this exception and how can I prevent this happen?

I put urgent in the title because I need to fix this problem by the end of today. Sorry about it.
Who is Participating?
Steven HarrisConnect With a Mentor PresidentCommented:
Check the following:

CSFilteringCheckBoxes line 399;
RunPerl line 202;
ToolBarListener line 278
All Courses

From novice to tech pro — start learning today.