]
Emmanuel Bernard commented on HHH-6442:
---------------------------------------
backported to 3.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-entity...
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: