Index: trunk/src/org/openstreetmap/josm/data/preferences/PreferencesReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/preferences/PreferencesReader.java	(revision 13714)
+++ trunk/src/org/openstreetmap/josm/data/preferences/PreferencesReader.java	(revision 13715)
@@ -27,15 +27,15 @@
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
 import javax.xml.validation.Validator;
 
 import org.openstreetmap.josm.io.CachedFile;
 import org.openstreetmap.josm.io.XmlStreamParsingException;
-import org.openstreetmap.josm.spi.preferences.Setting;
 import org.openstreetmap.josm.spi.preferences.ListListSetting;
 import org.openstreetmap.josm.spi.preferences.ListSetting;
 import org.openstreetmap.josm.spi.preferences.MapListSetting;
+import org.openstreetmap.josm.spi.preferences.Setting;
 import org.openstreetmap.josm.spi.preferences.StringSetting;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
 
@@ -97,5 +97,5 @@
     public static void validateXML(Reader in) throws IOException, SAXException {
         try (CachedFile cf = new CachedFile("resource://data/preferences.xsd"); InputStream xsdStream = cf.getInputStream()) {
-            Schema schema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(new StreamSource(xsdStream));
+            Schema schema = Utils.newXmlSchemaFactory().newSchema(new StreamSource(xsdStream));
             Validator validator = schema.newValidator();
             validator.validate(new StreamSource(in));
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 13714)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 13715)
@@ -48,4 +48,5 @@
 import java.util.Locale;
 import java.util.Optional;
+import java.util.ServiceConfigurationError;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Executor;
@@ -71,4 +72,5 @@
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
+import javax.xml.validation.SchemaFactory;
 
 import org.openstreetmap.josm.spi.preferences.Config;
@@ -1327,4 +1329,26 @@
         }
         return null;
+    }
+
+    /**
+     * Returns the W3C XML Schema factory implementation. Robust method dealing with ContextClassLoader problems.
+     * @return the W3C XML Schema factory implementation
+     * @since 13715
+     */
+    public static SchemaFactory newXmlSchemaFactory() {
+        try {
+            return SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+        } catch (ServiceConfigurationError e) {
+            Logging.debug(e);
+            // Can happen with icedtea-web. Use workaround from https://issues.apache.org/jira/browse/GERONIMO-6185
+            Thread currentThread = Thread.currentThread();
+            ClassLoader old = currentThread.getContextClassLoader();
+            currentThread.setContextClassLoader(null);
+            try {
+                return SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+            } finally {
+                currentThread.setContextClassLoader(old);
+            }
+        }
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 13714)
+++ trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 13715)
@@ -18,5 +18,4 @@
 import java.util.Stack;
 
-import javax.xml.XMLConstants;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.stream.StreamSource;
@@ -286,5 +285,5 @@
      */
     public Iterable<Object> startWithValidation(final Reader in, String namespace, String schemaSource) throws SAXException {
-        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+        SchemaFactory factory = Utils.newXmlSchemaFactory();
         try (CachedFile cf = new CachedFile(schemaSource); InputStream mis = cf.getInputStream()) {
             Schema schema = factory.newSchema(new StreamSource(mis));
