Index: modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java =================================================================== --- modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java (revision 2051) +++ modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java (working copy) @@ -171,6 +171,19 @@ public class JcrRepositoryFactory implements RepositoryFactory { assert configUrl != null; synchronized (ENGINES) { + /* + * Strip any query parameters from the incoming file URLs by creating a new URL with the same protocol, host, and port, + * but using the URL path as returned by URL#getPath() instead of the URL path and query parameters as returned by URL#getFile(). + */ + if ("file".equals(configUrl.getProtocol())) { + try { + configUrl = new URL(configUrl.getProtocol(), configUrl.getHost(), configUrl.getPort(), configUrl.getPath()); + } catch (MalformedURLException mfe) { + // This shouldn't be possible, since we're creating a new URL from an existing, valid URL + throw new IllegalStateException(mfe); + } + } + String configKey = configUrl.toString(); JcrEngine engine = ENGINES.get(configKey);