// shutdown the scheduler, otherwise Quartz scheduler and Threads still exists
Field schedulerField = repositoryTaskScheduler.getClass().getDeclaredField( "scheduler" );
schedulerField.setAccessible( true );
DefaultScheduler scheduler = (DefaultScheduler) schedulerField.get( repositoryTaskScheduler );
scheduler.stop();
}
catch ( Exception e )
{
e.printStackTrace();
}