[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5831) DTDEntityResolver should recognize systemId http://hibernate.org/dtd/... in addition to http://www.hibernate.org/dtd/
Michael Vorburger (JIRA)
noreply at atlassian.com
Mon Jan 10 20:23:05 EST 2011
DTDEntityResolver should recognize systemId http://hibernate.org/dtd/... in addition to http://www.hibernate.org/dtd/
---------------------------------------------------------------------------------------------------------------------
Key: HHH-5831
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5831
Project: Hibernate Core
Issue Type: Patch
Components: core
Affects Versions: 3.6.0
Reporter: Michael Vorburger
Priority: Minor
http://mifosforge.jira.com/browse/MIFOS-4456 identified a one of those "Hibernate tries to connect to http://hibernate.sourceforge.net at startup!" conditions.
On further analysis, and debug stepping-through the DTDEntityResolver, it turned out that some (but not all) *hbm.xml files (in Mifos) used e.g. http://hibernate.org/dtd/hibernate-configuration-3.0.dtd (note the missing www. before hibernate.org) instead of http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd - which is, actually, a valid URL as well, presumably because you DNS CNAME hiberate.org to www.hibernate.org (so this actually was never noticed before - it "worked", via Internet access).
Ideally, it would be nice & user friendly if the DTDEntityResolver would handle the (valid!) "shortened" system ID as well?
The suggested patch is to do something like:
{noformat}
private static final String HIBERNATE_NAMESPACE_SHORT = "http://hibernate.org/dtd/";
else if ( systemId.startsWith( HIBERNATE_NAMESPACE_SHORT ) ) {
log.debug( "recognized (short, no www.) hibernate namespace; attempting to resolve on classpath under org/hibernate/" );
source = resolveOnClassPath( publicId, systemId, HIBERNATE_NAMESPACE_SHORT );
}
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list