Solved

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

Posted on 2013-10-29
1
375 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This video teaches viewers about errors in exception handling.

828 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