Try doing this:
private void startTask() {// main method that creates the background task or class that implements the SwingWorker
AppContext appContext = AppContext.getAppContext();
if(appContext!=null){
appContext.remove(SwingWorker.class);
}
MassiveMigrationTask task = new MassiveMigrationTask();// class that implements the SwingWorker
task.execute();// this process implicitly adds the SwingWorker.class to the appContext
}
As the description: "The AppContext is a table referenced by ThreadGroup which stores application service instances."
So this issue is happening basically because the AppContext is saving the name of the thread called SwingWorker..., so if you try creating another instance of the thread you'll probably have no success, because it evaluates that thread name before executing a new one or at least put the new in the heap of threads to be executed, feel free consulting the code here:
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/awt/AppContext.java
PS: Important :"If you are not writing an application service, or don't know what one is, please do not use this class"