[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-6442) JarVisitorFactory is reconstructing URLs without the URLStreamHandler association

Emmanuel Bernard (JIRA) noreply at atlassian.com
Mon Jul 18 09:13:15 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bernard updated HHH-6442:
----------------------------------

    Affects Version/s: 3.6.5
        Fix Version/s: 4.0.0.next
                       3.6.6

> JarVisitorFactory is reconstructing URLs without the URLStreamHandler association
> ---------------------------------------------------------------------------------
>
>                 Key: HHH-6442
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6442
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: entity-manager
>    Affects Versions: 3.6.5, 4.0.0.Beta3
>            Reporter: Andrew Lee Rubinger
>             Fix For: 3.6.6, 4.0.0.next
>
>
> Problem in:
> https://github.com/ALRubinger/hibernate-core/blob/master/hibernate-entitymanager/src/main/java/org/hibernate/ejb/packaging/JarVisitorFactory.java#L88
> URLs, in order to be opened, must have an associated stream handler for a known protocol.  In the case that the protocol is not handled by Java built-in, the handler must either be attached to the URL instance or able to be looked up through the (IMO horribly designed) URL handler registration process.
> This line reconstructs a URL (which may have the URLStreamHandler association in place) into a new instance, leaving behind the handler in the process.  Nonstandard protocols will cease to work, as we now see in this test case from ShrinkWrap, for example:
> {code}final URL resource = shrinkWrapClassLoader.getResource(resourceName);
>       // Great, we already have a working URL.
>       // Now reconstruct the URL by composition of its pieces
>       try
>       {
>          new URL(resource.getProtocol(), resource.getHost(), resource.getPort(), resource.getFile());
>       }
>       catch (final MalformedURLException murle)
>       {
>          // Blow up
>          Assert.fail("Malformed URL should not be received when reconstructing a new URL from pieces of the one we already have");
>       }{code}
> Recommend we fix at the Hibernate level to properly resolve issues such as:
> https://issues.jboss.org/browse/ARQ-510

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list