GeoServerUserGroupService ugService =
GeoServerApplication.get().getSecurityManager()
.loadUserGroupService(userGroupsServiceName);
ugStore = new UserGroupStoreValidationWrapper(ugService.createStore());
for (GeoServerUserGroup group : removePanel.getRoots()) {
ugStore.removeGroup(group);
}
ugStore.store();
} catch (IOException ex) {
try {ugStore.load(); } catch (IOException ex2) {};
throw new RuntimeException(ex);