diff --git a/hibernate-core/src/main/java/org/hibernate/boot/xsd/LocalXsdResolver.java b/hibernate-core/src/main/java/org/hibernate/boot/xsd/LocalXsdResolver.java index 31ac6a838e..ea1acefe3e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/xsd/LocalXsdResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/xsd/LocalXsdResolver.java @@ -45,13 +45,6 @@ public class LocalXsdResolver { } public static URL resolveLocalXsdUrl(String resourceName) { - // first we try name as a URL - try { - return new URL( resourceName ); - } - catch (Exception ignore) { - } - try { final URL url = LocalXsdResolver.class.getClassLoader().getResource( resourceName ); if ( url != null ) { @@ -74,6 +67,13 @@ public class LocalXsdResolver { } } + // Last: we try name as a URL + try { + return new URL( resourceName ); + } + catch (Exception ignore) { + } + return null; }