Project

General

Profile

« Previous | Next » 

Revision 4978

Added by daigle over 15 years ago

Catch exception when schema exists in db but not on disk. Try to get the schema before throwing exception

View differences:

src/edu/ucsb/nceas/metacat/DBEntityResolver.java
139 139
      // check that it is accessible on our system before getting too far
140 140
      try {
141 141
    	  InputStream in = checkURLConnection(dbSystemID);
142
	  } catch (Exception e) {
143
		  // after an upgrade, the dtd will not exist on disk, but it is in xml catalog.  The db system id may be pointing 
144
		  // back at this system  Try and download it from the original system id and see if we still have a problem
145
		  // checking the URL connection.
146
		  logMetacat.warn("dtd for doc type " + doctype + " existed in xml catalog, but not on disk.  Uploading from: " + systemId);
147
		  InputStream istream = checkURLConnection(systemId);
148
		  uploadDTDFromURL(istream, systemId);
149
		  try {
150
			  checkURLConnection(dbSystemID);
151
		  } catch (Exception e2) {
152
			  logMetacat.error("still could not find dtd for doc type " + doctype + " at " 
153
					  + dbSystemID + " : " + e2.getMessage());
154
			  dbSystemID = null;
155
		  }
142 156
	  }
143
      catch (Exception e) {
144
    	  dbSystemID = null;
145
	  }
146 157
      boolean doctypeIsInDB = true;
147 158
      // no System ID found in db XML Catalog
148 159
      if (dbSystemID == null) {

Also available in: Unified diff