Index: modeshape-jcr/src/main/java/org/modeshape/jcr/JcrI18n.java =================================================================== --- modeshape-jcr/src/main/java/org/modeshape/jcr/JcrI18n.java (revision 2488) +++ modeshape-jcr/src/main/java/org/modeshape/jcr/JcrI18n.java (working copy) @@ -58,6 +58,7 @@ public final class JcrI18n { public static I18n unableToFindNodeTypeDefinitionsOnClasspathOrFileOrUrl; public static I18n unableToFindResourceOnClasspathOrFileOrUrl; public static I18n fileMustExistAndBeReadable; + public static I18n invalidJcrUrl; public static I18n rootNodeHasNoParent; public static I18n rootNodeIsNotProperty; Index: modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java =================================================================== --- modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java (revision 2488) +++ modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java (working copy) @@ -417,6 +417,10 @@ public class JcrRepositoryFactory implements RepositoryFactory { * @return the URL version of {@code jcrUrl} if {@code jcrUrl} is a valid URL, otherwise null */ private URL urlFor( String jcrUrl ) { + if (jcrUrl == null || jcrUrl.isEmpty()) { + throw new IllegalStateException(JcrI18n.invalidJcrUrl.text(jcrUrl)); + } + try { return new URL(jcrUrl.toString()); } catch (MalformedURLException mue) { Index: modeshape-jcr/src/main/resources/org/modeshape/jcr/JcrI18n.properties =================================================================== --- modeshape-jcr/src/main/resources/org/modeshape/jcr/JcrI18n.properties (revision 2488) +++ modeshape-jcr/src/main/resources/org/modeshape/jcr/JcrI18n.properties (working copy) @@ -48,6 +48,7 @@ errorLoadingNodeTypeDefintions = Error loading CND file "{0}": {1} unableToFindNodeTypeDefinitionsOnClasspathOrFileOrUrl = Unable to find the node type definition file "{0}" on the classpath, as a relative or absolute file, or resolve as a URL unableToFindResourceOnClasspathOrFileOrUrl = Unable to find "{0}" on the classpath, as a relative or absolute file, or resolve as a URL fileMustExistAndBeReadable = The file at "{0}" must exist and be readable +invalidJcrUrl = A valid JCR URL must be provided to use this method. "{0}" is not a valid JCR URL. Please consult the ModeShape Reference Guide for information on providing a valid JCR URL. rootNodeHasNoParent = The root node has no parent node rootNodeIsNotProperty = The root path "/" refers to the root node, not a property