Exception in thread "Thread-0" java.util.NoSuchElementException
at java.util.LinkedList.remove(LinkedList.java:805)
at java.util.LinkedList.removeFirst(LinkedList.java:151)
at java.util.LinkedList.remove(LinkedList.java:498)
at getIPAddress.appendTextFile(prog8.java:135)
at getIPAddress.run(prog8.java:66)
at java.lang.Thread.run(Thread.java:636)

Below is the program.

//You should have a very neat dnsServer.txt file.
// Format for file should follow below
// SERVER START putdate
// CLIENT DATE putdate CONNECT PORT num IP num
// CLIENT DATE putdate REQUEST url_requested
// CLIENT DATE putdate CLOSE
// You should have one thread that is the writer to the file
// that is spawned first by the main.
// HINT: If clientNo ==1, run method should run logger code
// else it is a client connecting
// You have one queue of strings. Clients put onto the queue,
// the logger writes to the file. No thread can access the
// queue while another is accessing the queue
//

846542 wrote:
I am new to Java programming I am getting this error called

Exception in thread "Thread-0" java.util.NoSuchElementException
at java.util.LinkedList.remove(LinkedList.java:805)
at java.util.LinkedList.removeFirst(LinkedList.java:151)
at java.util.LinkedList.remove(LinkedList.java:498)
at getIPAddress.appendTextFile(prog8.java:135)
at getIPAddress.run(prog8.java:66)
at java.lang.Thread.run(Thread.java:636)

What do you think happens if fileQueue is empty when you call appendTextFile() ?