This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes java.lang.IllegalThreadStateException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "java.lang.IllegalThreadStateException" Watch "java.lang.IllegalThreadStateException" New topic
Author

java.lang.IllegalThreadStateException

Urs Waefler
Ranch Hand

Joined: Mar 13, 2007
Posts: 77
Hi

This is my code:



I do not understand java.lang.IllegalThreadStateException? How should I correct my code?

Regards, Urs

SCJP 1.4
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12271
    
    1
Where is the rest of the Exception stack trace? That information is generated to help you understand the cause, don't throw it away.

Bill

Java Resources at www.wbrogden.com
Urs Waefler
Ranch Hand

Joined: Mar 13, 2007
Posts: 77
It looks like that:

Exception in thread "main" java.lang.IllegalThreadStateException
at java.lang.Thread.start(Unknown Source)
at Banking.main(Banking.java:93)

How can I correct this issue?
Raaghu Kannan
Greenhorn

Joined: Aug 19, 2011
Posts: 8
You are starting the same thread twice

Once in Clerk Constructor
Once in your main method.

Remove one of them , better to remove from Constructor.

Thanks and Regards
Raaghu.K
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.IllegalThreadStateException
 
Similar Threads
Thread question
Banking with Threads
Bank account simulation
How to get a transfer function to work both ways?
Program like ATM where person enters amount in dollars and cents but program uses int for monies