// Configures user realms
Iterator realmsIterator = userRealms.iterator();
while (realmsIterator.hasNext())
{
UserRealm realm = (UserRealm) realmsIterator.next();
server.addUserRealm(realm);
}
// Does not cache resources, to prevent Windows from locking files
Resource.setDefaultUseCaches(false);