From a7f5bc1a7de821bc8892e51fd79fbd36a04751a0 Mon Sep 17 00:00:00 2001 From: Andrew Lee Rubinger Date: Fri, 15 Jul 2011 17:02:41 -0400 Subject: [PATCH] [HHH-6442] In the case a URL cannot be reconstructed due to MalformedURLException, use the one passed in (which will already have a URLStreamHandler association) --- .../hibernate/ejb/packaging/JarVisitorFactory.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/ejb/packaging/JarVisitorFactory.java b/hibernate-entitymanager/src/main/java/org/hibernate/ejb/packaging/JarVisitorFactory.java index 8e65dc5b3b..9e53bcbf25 100644 --- a/hibernate-entitymanager/src/main/java/org/hibernate/ejb/packaging/JarVisitorFactory.java +++ b/hibernate-entitymanager/src/main/java/org/hibernate/ejb/packaging/JarVisitorFactory.java @@ -85,7 +85,17 @@ public class JarVisitorFactory { } } else { - jarUrl = new URL( protocol, url.getHost(), url.getPort(), file ); + try { + //We reconstruct the URL probably to make it work in some specific environments + //Forgot the exact details, sorry (and the Git history does not help) + jarUrl = new URL( protocol, url.getHost(), url.getPort(), file ); + } + //HHH-6442: Arquilian + catch ( final MalformedURLException murle ) { + //Just use the provided URL as-is, likely it has a URLStreamHandler + //associated w/ the instance + jarUrl = url; + } } } catch (MalformedURLException e) {