public InputSource resolveEntity(String publicId, String systemId) { log.trace("Resolving XML entity {} : {}", publicId, systemId); InputSource is = super.resolveEntity( publicId, systemId ); if ( is == null ) { if ( systemId != null ) {
log.debug( "recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/" ); String path = "org/hibernate/" + systemId.substring( HIBERNATE_NAMESPACE.length() ); InputStream dtdStream = resolveInHibernateNamespace( path ); if ( dtdStream == null ) { log.debug( "unable to locate [" + systemId + "] on classpath" ); log.debug( "recognized local namespace; attempting to resolve on classpath" ); String path = systemId.substring( USER_NAMESPACE.length() ); InputStream stream = resolveInLocalNamespace( path ); if ( stream == null ) { log.debug( "unable to locate [" + systemId + "] on classpath" );
public InputSource resolveEntity( String publicId, String systemId ) { log.debug( "Trying to resolve system id: " + systemId ); if ( systemId != null && systemId.startsWith( PREFIX ) ) { // Remove the initial slash and look it up String resource = systemId.substring( PREFIX.length() ); log.debug( "Looking up entity on classpath: " + resource ); InputStream stream = getClass().getResourceAsStream( resource ); if ( stream == null ) { stream = getClass().getClassLoader() .getResourceAsStream( resource ); } if ( stream == null ) { stream = Thread.currentThread().getContextClassLoader() .getResourceAsStream( resource ); } if ( stream == null ) { log.error( "Couldn't find entity in classpath: " + resource ); } else { log.debug( "Found entity on classpath: " + resource ); InputSource source = new InputSource( stream ); source.setPublicId( publicId ); source.setSystemId( systemId ); return source; } } return super.resolveEntity( publicId, systemId ); }
public InputSource resolveEntity(String publicId, String systemId) { InputSource is = super.resolveEntity( publicId, systemId ); if ( is == null ) { if ( systemId != null ) {