Index: /applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/ValidatingImageryReader.java
===================================================================
--- /applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/ValidatingImageryReader.java	(revision 35721)
+++ /applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/ValidatingImageryReader.java	(revision 35722)
@@ -4,12 +4,10 @@
 import java.io.IOException;
 
-import javax.xml.XMLConstants;
 import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
 
 import org.openstreetmap.josm.io.CachedFile;
 import org.openstreetmap.josm.io.imagery.ImageryReader;
 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsConstants;
+import org.openstreetmap.josm.tools.XmlUtils;
 import org.xml.sax.SAXException;
 
@@ -52,8 +50,8 @@
      */
     public static void validate(String source) throws SAXException, IOException {
-        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
         try (CachedFile xmlSchema = new CachedFile(XML_SCHEMA)) {
-            Schema schema = factory.newSchema(new StreamSource(xmlSchema.getInputStream()));
-            schema.newValidator().validate(new StreamSource(source));
+            XmlUtils.newXmlSchemaFactory()
+                .newSchema(new StreamSource(xmlSchema.getInputStream()))
+                .newValidator().validate(new StreamSource(source));
         }
     }
Index: /applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsImporter.java
===================================================================
--- /applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsImporter.java	(revision 35721)
+++ /applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/io/XmlBoundsImporter.java	(revision 35722)
@@ -64,13 +64,13 @@
             entries = reader.parse();
         } catch (SAXException e) {
-      	    Logging.trace(e);
-            if (JOptionPane.showConfirmDialog(
+      	    Logging.warn(e);
+      	    if (JOptionPane.YES_OPTION != GuiHelper.runInEDTAndWaitAndReturn(() -> JOptionPane.showConfirmDialog(
                     MainApplication.getMainFrame(),
                     tr("Validating error in file {0}:\n{1}\nDo you want to continue without validating the file ?",
                             source != null ? source : file.getPath(), e.getLocalizedMessage()),
                     tr("Open Imagery XML file"),
-                    JOptionPane.YES_NO_CANCEL_OPTION) != JOptionPane.YES_OPTION) {
-                return null;
-            }
+                    JOptionPane.YES_NO_CANCEL_OPTION))) {
+      	        return null;
+      	    }
 
             try (ImageryReader reader = new ImageryReader(source != null ? source : file.getAbsolutePath())) {
