private void addServletWithDefaultConfiguration(ServletContext sc, Set<Class<?>> classes) {
ServletRegistration appReg = sc.getServletRegistration(Application.class.getName());
if (appReg != null && appReg.getClassName() == null) {
final Set<Class<?>> x = getRootResourceAndProviderClasses(classes);
final ServletContainer s = new ServletContainer(
new DefaultResourceConfig(x));
appReg = sc.addServlet(appReg.getName(), s);
if (appReg.getMappings().isEmpty()) {
// Error
LOGGER.severe("The Jersey servlet application, named " +