Solved

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

Posted on 2013-10-29
1
374 Views
Last Modified: 2013-10-29
Hi,
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
etTableDataInitialData(CSFilteringCheckBoxes.java:399)
        at com.something.RunPerl.runMtcheck(RunP
erl.java:202)
        at com.something.ToolBarListener$1.run(T
oolBarListener.java:278)
        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.
0
Comment
Question by:Tolgar
1 Comment
 
LVL 18

Accepted Solution

by:
Steven Harris earned 500 total points
ID: 39610256
Check the following:

CSFilteringCheckBoxes line 399;
RunPerl line 202;
ToolBarListener line 278
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question