Retrieve Data Thread blocks UI

Hi,

for my backend I have a server, a middleware and my vaadin application. The connection between them is implemented with RMI.
Now when my Vaadin application has to fetch some data I have implemented a Thread that calls (static) the Data Retriever function from the middleware. Now the middleware has to do some work like retrieving Data from the Server or from a different SQL Database.
But in my Vaadin application I have the problem that my Thread finishes but the UI is still blocked for some seconds because of the call of the data retriever function.
This is how my thread looks like. The output of “Thread started” and “Thread finished” is displayed after a few ms. But the UI is still blocked for 4-5 seconds (the blue loading bar on top appears). If i dont call the getMyData function the UI isn´t blocked.
Any idea how I can get the thread to retrieve my data without blocking the UI?

class MyThread extends Thread {
@Override
public void run() {
  System.out.println("Thread started");
  MyData myData = DataRetriever.getMyData();
  System.out.println("Thread finished");
}

}

How are you starting the thread? Seems like you are executing your code in the same thread that serves the servlet request instead of a separeted thread

I am starting the Thread with a static threadpool. I add the thread to the threadpool and so it is started.
But I also tried to run the threads without the threadpool and start it normally with myThread.run().