The following Function is executing in its own thread:
private void doSendData() { try { //writeToFile(); // just a temporary location of a c
To avoid that error message, use the synchronized keyword:
synchronized(serverAddr){ serverAddr.wait(60000); }