Revision 675
Added by berkley almost 24 years ago
src/edu/ucsb/nceas/metacat/DBValidate.java | ||
---|---|---|
74 | 74 |
parser.setFeature("http://xml.org/sax/features/validation",true); |
75 | 75 |
//parser.setValidationMode(true); // Oracle |
76 | 76 |
} catch (Exception e) { |
77 |
System.err.println("Could not create parser!!!");
|
|
77 |
System.err.println("Could not create parser in DBValidate.DBValidate");
|
|
78 | 78 |
} |
79 | 79 |
} |
80 | 80 |
|
... | ... | |
88 | 88 |
myCatalog.loadSystemCatalogs(); |
89 | 89 |
myCatalog.parseCatalog(xmlcatalogfile); |
90 | 90 |
cer.setCatalog(myCatalog); |
91 |
} catch (Exception e) {System.out.println("Problem creating Catalog!");} |
|
91 |
} catch (Exception e) { |
|
92 |
System.out.println("Problem creating Catalog in DBValidate.DBValidate"); |
|
93 |
} |
|
92 | 94 |
|
93 | 95 |
parser.setEntityResolver(cer); |
94 | 96 |
} |
... | ... | |
114 | 116 |
try { |
115 | 117 |
parser.parse((createURL(xml_doc)).toString()); |
116 | 118 |
} catch (IOException e) { |
117 |
System.out.println("IOException:Could not parse :"+xml_doc); |
|
119 |
System.out.println("IOException:Could not parse :" + xml_doc + |
|
120 |
" from DBValidate.validate"); |
|
118 | 121 |
ParseError eip = null; |
119 | 122 |
eip = new ParseError("",0,0, |
120 | 123 |
"IOException:Could not parse :"+xml_doc); |
... | ... | |
148 | 151 |
try { |
149 | 152 |
parser.parse(is); |
150 | 153 |
} |
151 |
catch (Exception e) {System.out.println("Error in parsing!");} |
|
154 |
catch (Exception e) { |
|
155 |
System.out.println("Error in parsing in DBValidate.validateString"); |
|
156 |
} |
|
152 | 157 |
|
153 | 158 |
if (ef != null && ef.getErrorNodes()!=null && |
154 | 159 |
ef.getErrorNodes().size() > 0 ) { |
src/edu/ucsb/nceas/metacat/AuthLdap.java | ||
---|---|---|
104 | 104 |
} |
105 | 105 |
|
106 | 106 |
} catch (AuthenticationException ae) { |
107 |
util.debugMessage("Error authenticating: " + ae); |
|
107 |
util.debugMessage("Error authenticating in AuthLdap.authenticate: " + ae);
|
|
108 | 108 |
// NEED TO THROW THE RIGHT EXCEPTION HERE |
109 | 109 |
return false; |
110 | 110 |
} catch (NamingException e) { |
111 |
util.debugMessage("Naming exception while authenticating: " + e); |
|
111 |
util.debugMessage("Naming exception while authenticating in " + |
|
112 |
"AuthLdap.authenticate: " + e); |
|
112 | 113 |
// NEED TO THROW THE RIGHT EXCEPTION HERE |
113 | 114 |
return false; |
114 | 115 |
} |
... | ... | |
227 | 228 |
// Close the context when we're done |
228 | 229 |
ctx.close(); |
229 | 230 |
} catch (NamingException e) { |
230 |
System.err.println("Problem getting attributes: " + e); |
|
231 |
System.err.println("Problem getting attributes in AuthLdap.getAttributes:" |
|
232 |
+ e); |
|
231 | 233 |
// NEED TO THROW THE RIGHT EXCEPTION HERE |
232 | 234 |
} |
233 | 235 |
|
... | ... | |
297 | 299 |
ctx.close(); |
298 | 300 |
} catch (NamingException e) { |
299 | 301 |
util.debugMessage("Naming exception while getting dn: " + e); |
302 |
System.out.println("Naming exception in AuthLdap.getIdentifyingName"); |
|
300 | 303 |
// NEED TO THROW THE RIGHT EXCEPTION HERE |
301 | 304 |
return null; |
302 | 305 |
} |
... | ... | |
342 | 345 |
} |
343 | 346 |
|
344 | 347 |
} catch (ConnectException ce) { |
345 |
System.err.println("Error connecting to LDAP server.");
|
|
348 |
System.err.println("Error connecting to LDAP server in authldap.main");
|
|
346 | 349 |
} |
347 | 350 |
} |
348 | 351 |
} |
src/edu/ucsb/nceas/metacat/AuthSession.java | ||
---|---|---|
81 | 81 |
return false; |
82 | 82 |
} |
83 | 83 |
} catch ( ConnectException ce ) { |
84 |
message = "Connection to the authentication service failed. "
|
|
85 |
+ ce.getMessage();
|
|
84 |
message = "Connection to the authentication service failed in " +
|
|
85 |
"AuthSession.authenticate: " + ce.getMessage();
|
|
86 | 86 |
} catch ( IllegalStateException ise ) { |
87 | 87 |
message = ise.getMessage(); |
88 | 88 |
} |
src/edu/ucsb/nceas/metacat/QuerySpecification.java | ||
---|---|---|
98 | 98 |
try { |
99 | 99 |
parser.parse(new InputSource(queryspec)); |
100 | 100 |
} catch (SAXException e) { |
101 |
System.err.println("error parsing data"); |
|
101 |
System.err.println("error parsing data in " + |
|
102 |
"QuerySpecification.QuerySpecification"); |
|
102 | 103 |
System.err.println(e.getMessage()); |
103 | 104 |
} |
104 | 105 |
} |
... | ... | |
185 | 186 |
parser.setErrorHandler(this); |
186 | 187 |
|
187 | 188 |
} catch (Exception e) { |
188 |
System.err.println(e.toString()); |
|
189 |
System.err.println("Error in QuerySpcecification.initializeParser " + |
|
190 |
e.toString()); |
|
189 | 191 |
} |
190 | 192 |
|
191 | 193 |
return parser; |
src/edu/ucsb/nceas/metacat/MetacatReplication.java | ||
---|---|---|
268 | 268 |
} |
269 | 269 |
catch(Exception e) |
270 | 270 |
{ |
271 |
System.out.println("error in handleServerControlRequest " + |
|
271 |
System.out.println("error in " + |
|
272 |
"MetacatReplication.handleServerControlRequest " + |
|
272 | 273 |
e.getMessage()); |
273 | 274 |
e.printStackTrace(System.out); |
274 | 275 |
} |
... | ... | |
394 | 395 |
} |
395 | 396 |
catch(Exception e) |
396 | 397 |
{ |
397 |
System.out.println("error requesting file lock: " + e.getMessage()); |
|
398 |
System.out.println("error requesting file lock from MetacatReplication." + |
|
399 |
"handleGetLockRequest: " + e.getMessage()); |
|
398 | 400 |
e.printStackTrace(System.out); |
399 | 401 |
} |
400 | 402 |
} |
... | ... | |
430 | 432 |
} |
431 | 433 |
catch (Exception e) |
432 | 434 |
{ |
433 |
System.out.println("error in metacatReplication.handlegetdocumentinforequest: " + |
|
434 |
e.getMessage()); |
|
435 |
System.out.println("error in " + |
|
436 |
"metacatReplication.handlegetdocumentinforequest: " + |
|
437 |
e.getMessage()); |
|
435 | 438 |
} |
436 | 439 |
|
437 | 440 |
} |
... | ... | |
456 | 459 |
} |
457 | 460 |
catch(Exception e) |
458 | 461 |
{ |
459 |
System.out.println("error getting document: " + e.getMessage()); |
|
462 |
System.out.println("error getting document from MetacatReplication." + |
|
463 |
"handlGetDocumentRequest " + e.getMessage()); |
|
460 | 464 |
} |
461 | 465 |
|
462 | 466 |
} |
... | ... | |
562 | 566 |
} |
563 | 567 |
catch(Exception e) |
564 | 568 |
{ |
565 |
System.out.println("error in handleupdaterequest2: " + e.getMessage()); |
|
569 |
System.out.println("error in MetacatReplication.handleupdaterequest: " + |
|
570 |
e.getMessage()); |
|
566 | 571 |
e.printStackTrace(System.out); |
567 | 572 |
} |
568 | 573 |
|
... | ... | |
634 | 639 |
} |
635 | 640 |
catch(Exception ee) |
636 | 641 |
{} |
637 |
System.out.println("error in handleGetCatalogRequest: " + e.getMessage()); |
|
642 |
System.out.println("error in MetacatReplication.handleGetCatalogRequest:"+ |
|
643 |
e.getMessage()); |
|
638 | 644 |
e.printStackTrace(System.out); |
639 | 645 |
} |
640 | 646 |
return null; |
... | ... | |
682 | 688 |
} |
683 | 689 |
catch(Exception e) |
684 | 690 |
{ |
685 |
System.out.println("error in file lock thread: " + e.getMessage()); |
|
691 |
System.out.println("error in file lock thread from MetacatReplication." + |
|
692 |
"run: " + e.getMessage()); |
|
686 | 693 |
} |
687 | 694 |
} |
688 | 695 |
|
... | ... | |
815 | 822 |
} |
816 | 823 |
catch(Exception e) |
817 | 824 |
{ |
818 |
System.out.println("error writing to replication log"); |
|
825 |
System.out.println("error writing to replication log from " + |
|
826 |
"MetacatReplication.replLog: " + e.getMessage()); |
|
819 | 827 |
//e.printStackTrace(System.out); |
820 | 828 |
} |
821 | 829 |
} |
... | ... | |
856 | 864 |
} |
857 | 865 |
catch(Exception e) |
858 | 866 |
{ |
859 |
System.out.println("error in replToServer: " + e.getMessage()); |
|
867 |
System.out.println("error in MetacatReplication.replToServer: " + |
|
868 |
e.getMessage()); |
|
860 | 869 |
} |
861 | 870 |
finally |
862 | 871 |
{ |
src/edu/ucsb/nceas/metacat/DBQuery.java | ||
---|---|---|
105 | 105 |
System.out.println(result); |
106 | 106 |
|
107 | 107 |
} catch (Exception e) { |
108 |
System.err.println("EXCEPTION HANDLING REQUIRED");
|
|
108 |
System.err.println("Error in DBQuery.main");
|
|
109 | 109 |
System.err.println(e.getMessage()); |
110 | 110 |
e.printStackTrace(System.err); |
111 | 111 |
} |
... | ... | |
237 | 237 |
} |
238 | 238 |
catch(Exception e) |
239 | 239 |
{ |
240 |
System.out.println("Error getting document: " + e.getMessage()); |
|
240 |
System.out.println("Error getting document in " + |
|
241 |
"DBQuery.findDocuments: " + e.getMessage()); |
|
241 | 242 |
} |
242 | 243 |
|
243 | 244 |
docid = xmldoc.getDocID(); |
... | ... | |
393 | 394 |
System.err.println("SQL Error in DBQuery.findDocuments: " + |
394 | 395 |
e.getMessage()); |
395 | 396 |
} catch (IOException ioe) { |
396 |
System.err.println("Error printing qspec:");
|
|
397 |
System.err.println("IO error in DBQuery.findDocuments:");
|
|
397 | 398 |
System.err.println(ioe.getMessage()); |
398 | 399 |
} catch (Exception ee) { |
399 |
System.out.println("error in DBQuery.findDocuments: " +
|
|
400 |
System.out.println("Exception in DBQuery.findDocuments: " +
|
|
400 | 401 |
ee.getMessage()); |
401 | 402 |
} |
402 | 403 |
finally { |
... | ... | |
449 | 450 |
} |
450 | 451 |
catch (SQLException e) |
451 | 452 |
{ |
452 |
System.err.println("Error getting id: " + e.getMessage());
|
|
453 |
System.err.println("Error in DBQuery.getNodeContent: " + e.getMessage());
|
|
453 | 454 |
} finally { |
454 | 455 |
try |
455 | 456 |
{ |
src/edu/ucsb/nceas/metacat/DBTransform.java | ||
---|---|---|
84 | 84 |
dp.parse((Reader)(new StringReader(doc))); |
85 | 85 |
new XSLProcessor().processXSL(style, dp.getDocument(), pw); |
86 | 86 |
} catch (Exception e) { |
87 |
pw.println(xsl_system_id + "Error transforming document:\n" + |
|
87 |
pw.println(xsl_system_id + "Error transforming document in " + |
|
88 |
"DBTransform.transformXMLDocument: " + |
|
88 | 89 |
e.getMessage()); |
89 | 90 |
} |
90 | 91 |
} else { |
... | ... | |
127 | 128 |
try { |
128 | 129 |
the_system_id = rs.getString(1); |
129 | 130 |
} catch (SQLException e) { |
130 |
System.out.println("Error with getString: " + e.getMessage()); } |
|
131 |
System.out.println("Error with getString in " + |
|
132 |
"DBTransform.getSystemId: " + e.getMessage()); |
|
133 |
} |
|
131 | 134 |
} else { |
132 | 135 |
the_system_id = null; |
133 | 136 |
} |
134 | 137 |
} catch (SQLException e) { |
135 |
System.err.println("Error with next: " + e.getMessage()); |
|
138 |
System.err.println("Error with next in DBTransform.getSystemId: " + |
|
139 |
e.getMessage()); |
|
136 | 140 |
return ("Error with next: " + e.getMessage()); |
137 | 141 |
} |
138 | 142 |
} catch (SQLException e) { |
139 |
System.err.println("Error with getrset: " + e.getMessage()); |
|
143 |
System.err.println("Error with getrset in DBTransform.getSystemId: " + |
|
144 |
e.getMessage()); |
|
140 | 145 |
return ("Error with getrset: " + e.getMessage()); |
141 | 146 |
} |
142 | 147 |
pstmt.close(); |
143 | 148 |
} catch (SQLException e) { |
144 |
System.err.println("Error getting id: " + e.getMessage()); |
|
145 |
return ("Error getting id: " + e.getMessage()); |
|
149 |
System.err.println("Error getting id in DBTransform.getSystemId: " + |
|
150 |
e.getMessage()); |
|
151 |
return ("Error getting id in DBTransform.getSystemId:: " + |
|
152 |
e.getMessage()); |
|
146 | 153 |
} |
147 | 154 |
return the_system_id; |
148 | 155 |
} |
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
195 | 195 |
// Open a pool of db connections |
196 | 196 |
connectionPool = util.getConnectionPool(); |
197 | 197 |
} catch (Exception e) { |
198 |
System.err.println("Error creating pool of database connections"); |
|
198 |
System.err.println("Error creating pool of database connections in " + |
|
199 |
" MetaCatServlet.handleGetOrPost"); |
|
199 | 200 |
System.err.println(e.getMessage()); |
200 | 201 |
} |
201 | 202 |
} |
... | ... | |
303 | 304 |
try { |
304 | 305 |
handleReadAction(/*out,*/ params, response, username); |
305 | 306 |
} catch (ClassNotFoundException e) { |
306 |
System.out.println(e.getMessage()); |
|
307 |
System.out.println("Error in MetacatServlet.handlGetOrPost: " + |
|
308 |
e.getMessage()); |
|
307 | 309 |
} catch (SQLException se) { |
308 |
System.out.println(se.getMessage()); |
|
310 |
System.out.println("Error in MetaCatServlet.handleGetOrPost: " + |
|
311 |
se.getMessage()); |
|
309 | 312 |
} |
310 | 313 |
} |
311 | 314 |
/* |
... | ... | |
344 | 347 |
} |
345 | 348 |
catch(Exception e) |
346 | 349 |
{ |
347 |
out.println("error viewing abstract: " + e.getMessage()); |
|
350 |
out.println("error viewing abstract from " + |
|
351 |
"MetacatServlet.handleGetorPost: " + e.getMessage()); |
|
348 | 352 |
} |
349 | 353 |
} else if (action.equals("getdatadoc")) { |
350 | 354 |
response.setContentType("application/zip"); |
... | ... | |
402 | 406 |
out.println("</body>"); |
403 | 407 |
out.close(); |
404 | 408 |
} catch (MalformedURLException mue) { |
409 |
System.out.println("bad url from MetacatServlet.handleGetOrPost"); |
|
405 | 410 |
out.println(mue.getMessage()); |
406 | 411 |
mue.printStackTrace(out); |
407 | 412 |
out.close(); |
... | ... | |
488 | 493 |
} |
489 | 494 |
catch (Exception e) |
490 | 495 |
{ |
491 |
System.out.println("error in handleGetDataPortAction: " + e.getMessage()); |
|
496 |
System.out.println("error in MetacatServlet.handleGetDataPortAction: " + |
|
497 |
e.getMessage()); |
|
492 | 498 |
} |
493 | 499 |
} |
494 | 500 |
|
... | ... | |
508 | 514 |
try { |
509 | 515 |
sess = new AuthSession(); |
510 | 516 |
} catch (Exception e) { |
517 |
System.out.println("error in MetacatServlet.handleLoginAction: " + |
|
518 |
e.getMessage()); |
|
511 | 519 |
out.println(e.getMessage()); |
512 | 520 |
return; |
513 | 521 |
} |
... | ... | |
735 | 743 |
catch (Exception e) |
736 | 744 |
{ |
737 | 745 |
util.returnConnection(conn); |
738 |
util.debugMessage("Error in runQuery: " + e.getMessage()); |
|
746 |
util.debugMessage("Error in MetacatServlet.runQuery: " + e.getMessage());
|
|
739 | 747 |
doclist = null; |
740 | 748 |
return doclist; |
741 | 749 |
} |
... | ... | |
847 | 855 |
} |
848 | 856 |
catch (IOException ioe) |
849 | 857 |
{ |
850 |
util.debugMessage("error in handlegetabstract: " + ioe.getMessage()); |
|
858 |
util.debugMessage("error in MetacatServlet.handlegetabstract: " + |
|
859 |
ioe.getMessage()); |
|
860 |
System.out.println("IO error in MetacatServlet.handlegetabstract: " + |
|
861 |
ioe.getMessage()); |
|
851 | 862 |
} |
852 | 863 |
catch(SQLException sqle) |
853 | 864 |
{ |
854 |
util.debugMessage("error in handlegetabstract: " + sqle.getMessage()); |
|
865 |
util.debugMessage("sql error in MetacatServLet.handlegetabstract: " + |
|
866 |
sqle.getMessage()); |
|
867 |
System.out.println("sql error in MetacatServLet.handlegetabstract: " + |
|
868 |
sqle.getMessage()); |
|
855 | 869 |
} |
856 | 870 |
catch(Exception e) |
857 | 871 |
{ |
858 | 872 |
util.debugMessage("error in handlegetabstract: " + e.getMessage()); |
873 |
System.out.println("error in MetacatServlEt.handlegetabstract: " + |
|
874 |
e.getMessage()); |
|
859 | 875 |
} |
860 | 876 |
|
861 | 877 |
util.returnConnection(conn); |
... | ... | |
936 | 952 |
} |
937 | 953 |
catch(Exception e) |
938 | 954 |
{ |
939 |
util.debugMessage("error viewing html document"); |
|
955 |
System.out.println("error viewing html document from " + |
|
956 |
"MetacatServlet.handleGetRelatedDocumentAction: " + |
|
957 |
e.getMessage()); |
|
940 | 958 |
} |
941 | 959 |
} |
942 | 960 |
} |
... | ... | |
976 | 994 |
handleGetRelatedDocumentAction(out, params, response, murl); |
977 | 995 |
} |
978 | 996 |
} catch (MalformedURLException mue) { |
979 |
System.out.println("in catch"); |
|
980 | 997 |
out = response.getWriter(); |
981 | 998 |
handleGetDocumentAction(out, params, response); |
982 | 999 |
} |
... | ... | |
1056 | 1073 |
} |
1057 | 1074 |
catch(Exception e) |
1058 | 1075 |
{ |
1059 |
System.out.println("error in handleGetData: " + e.getMessage()); |
|
1076 |
System.out.println("error in MetacatServlet.handleGetData: " + |
|
1077 |
e.getMessage()); |
|
1060 | 1078 |
e.printStackTrace(System.out); |
1061 | 1079 |
} |
1062 | 1080 |
} |
... | ... | |
1416 | 1434 |
} |
1417 | 1435 |
catch(Exception e) |
1418 | 1436 |
{ |
1419 |
util.debugMessage("error downloading html document"); |
|
1437 |
System.out.println("error downloading html document "+ |
|
1438 |
"in metacatServlet.handleGetDataDocumentAction"); |
|
1420 | 1439 |
} |
1421 | 1440 |
} |
1422 | 1441 |
} |
... | ... | |
1427 | 1446 |
} |
1428 | 1447 |
catch(Exception e) |
1429 | 1448 |
{ |
1430 |
System.out.println("Error creating zip file: " + e.getMessage()); |
|
1449 |
System.out.println("Error creating zip file from " + |
|
1450 |
"MetacatServlet.handleGetDataDocumentAction: " + |
|
1451 |
e.getMessage()); |
|
1431 | 1452 |
e.printStackTrace(System.out); |
1432 | 1453 |
} |
1433 | 1454 |
|
src/edu/ucsb/nceas/metacat/DBSAXHandler.java | ||
---|---|---|
181 | 181 |
docname, doctype, docid, action, user, |
182 | 182 |
this.serverCode); |
183 | 183 |
} catch (Exception ane) { |
184 |
throw (new SAXException("Error with " + action, ane)); |
|
184 |
throw (new SAXException("Error in DBSaxHandler.startElement " + |
|
185 |
action, ane)); |
|
185 | 186 |
} |
186 | 187 |
// not needed any more |
187 | 188 |
//rootNode.writeDocID(currentDocument.getDocID()); |
... | ... | |
251 | 252 |
dbconn.rollback(); |
252 | 253 |
dbconn.close(); |
253 | 254 |
} catch (SQLException sqle) {} |
254 |
System.out.println("Error writing ACL. " + e.getMessage()); |
|
255 |
System.out.println("Error writing ACL in DBSaxHandler.run " + |
|
256 |
e.getMessage()); |
|
255 | 257 |
} |
256 | 258 |
} |
257 | 259 |
|
... | ... | |
263 | 265 |
dbconn.rollback(); |
264 | 266 |
dbconn.close(); |
265 | 267 |
} catch (SQLException sqle) {} |
266 |
System.out.println("Error writing XML Index. " + e.getMessage()); |
|
268 |
System.out.println("Error writing XML Index in DBSaxHandler.run " + |
|
269 |
e.getMessage()); |
|
267 | 270 |
} |
268 | 271 |
} |
269 | 272 |
|
src/edu/ucsb/nceas/metacat/DataFileUploadInterface.java | ||
---|---|---|
84 | 84 |
} |
85 | 85 |
catch(UnknownHostException u) |
86 | 86 |
{ |
87 |
System.out.println("unknown host in DataFileUploadInterface.getSocket"); |
|
87 | 88 |
} |
88 | 89 |
catch(IOException i) |
89 | 90 |
{ |
... | ... | |
111 | 112 |
} |
112 | 113 |
catch(UnknownHostException u) |
113 | 114 |
{ |
114 |
//it better know localhost! |
|
115 |
System.out.println("unknow host error in " + |
|
116 |
"DataFileUploadInterface.portIsAvailable"); |
|
115 | 117 |
} |
116 | 118 |
catch(IOException i) |
117 | 119 |
{ |
src/edu/ucsb/nceas/metacat/DataFileServer.java | ||
---|---|---|
178 | 178 |
} |
179 | 179 |
catch(Exception ee) |
180 | 180 |
{ |
181 |
System.out.println("error: " + ee.getMessage()); |
|
181 |
System.out.println("error DataFileServer.run(): " + ee.getMessage());
|
|
182 | 182 |
} |
183 | 183 |
e.printStackTrace(System.out); |
184 | 184 |
} |
... | ... | |
186 | 186 |
catch(InterruptedIOException iioe) |
187 | 187 |
{ |
188 | 188 |
//the accept timeout passed |
189 |
//System.out.println("socket on port " + port + " timed out."); |
|
189 |
System.out.println("socket on port " + port + " timed out. " + |
|
190 |
" (DataFileServer.run)"); |
|
190 | 191 |
} |
191 | 192 |
catch (IOException ex) |
192 | 193 |
{ |
... | ... | |
200 | 201 |
} |
201 | 202 |
catch(Exception ee) |
202 | 203 |
{ |
203 |
System.out.println("error: " + ee.getMessage()); |
|
204 |
System.out.println("error in DataFileServer.run(): " + ee.getMessage());
|
|
204 | 205 |
} |
205 | 206 |
} |
206 | 207 |
finally |
src/edu/ucsb/nceas/metacat/DocumentImpl.java | ||
---|---|---|
111 | 111 |
} catch (McdbException ex) { |
112 | 112 |
throw ex; |
113 | 113 |
} catch (Throwable t) { |
114 |
throw new McdbException("Error reading document " + docid + "."); |
|
114 |
throw new McdbException("Error reading document from " + |
|
115 |
"DocumentImpl.DocumentImpl: " + docid); |
|
115 | 116 |
} |
116 | 117 |
} |
117 | 118 |
|
... | ... | |
473 | 474 |
} |
474 | 475 |
catch(Exception e) |
475 | 476 |
{ |
476 |
System.out.println("error in getDocumentInfo: " + e.getMessage()); |
|
477 |
System.out.println("error in DocumentImpl.getDocumentInfo: " + |
|
478 |
e.getMessage()); |
|
477 | 479 |
} |
478 | 480 |
|
479 | 481 |
//deal with the key words here. |
... | ... | |
514 | 516 |
//this.publicaccess = rs.getInt(10); |
515 | 517 |
this.rev = rs.getInt(10); |
516 | 518 |
} |
517 |
pstmt.close(); |
|
518 | 519 |
|
519 | 520 |
if (this.doctype != null) { |
520 | 521 |
pstmt = |
... | ... | |
530 | 531 |
if (tableHasRows) { |
531 | 532 |
this.system_id = rs.getString(1); |
532 | 533 |
} |
533 |
pstmt.close(); |
|
534 |
//pstmt.close();
|
|
534 | 535 |
} |
535 | 536 |
} catch (SQLException e) { |
536 |
System.out.println("error in getDocumentInfo: " + e.getMessage()); |
|
537 |
System.out.println("error in DocumentImpl.getDocumentInfo: " + |
|
538 |
e.getMessage()); |
|
537 | 539 |
e.printStackTrace(System.out); |
538 |
throw new McdbException("Error accessing database connection.", e); |
|
540 |
throw new McdbException("Error accessing database connection in " + |
|
541 |
"DocumentImpl.getDocumentInfo: ", e); |
|
539 | 542 |
} |
540 | 543 |
|
541 | 544 |
if (this.docname == null) { |
... | ... | |
595 | 598 |
pstmt.close(); |
596 | 599 |
|
597 | 600 |
} catch (SQLException e) { |
598 |
throw new McdbException("Error accessing database connection.", e); |
|
601 |
throw new McdbException("Error accessing database connection from " + |
|
602 |
"DocumentImpl.getNodeRecordList ", e); |
|
599 | 603 |
} |
600 | 604 |
|
601 | 605 |
if (nodeRecordList != null) { |
... | ... | |
651 | 655 |
pstmt = conn.prepareStatement( |
652 | 656 |
"DELETE FROM xml_index WHERE docid='" + this.docid + "'"); |
653 | 657 |
pstmt.execute(); |
654 |
pstmt.close(); |
|
658 |
//pstmt.close();
|
|
655 | 659 |
|
656 | 660 |
// Update the new document to reflect the new node tree |
657 | 661 |
pstmt = conn.prepareStatement( |
... | ... | |
713 | 717 |
pstmt.execute(); |
714 | 718 |
pstmt.close(); |
715 | 719 |
} catch (SQLException e) { |
716 |
System.out.println(e.getMessage()); |
|
720 |
System.out.println("Error in DocumentImpl.setTitle: " + e.getMessage());
|
|
717 | 721 |
} |
718 | 722 |
} |
719 | 723 |
|
src/edu/ucsb/nceas/metacat/AuthMcat.java | ||
---|---|---|
74 | 74 |
String name = "//" + srbHost + "/SrbJavaGlue"; |
75 | 75 |
srbJG = (SrbJavaGlueInterface)Naming.lookup(name); |
76 | 76 |
} catch (Exception e) { |
77 |
System.err.println("AuthMcat static: " + e.getMessage()); |
|
77 |
System.err.println("error in AuthMcat static: " + e.getMessage());
|
|
78 | 78 |
} |
79 | 79 |
} |
80 | 80 |
|
... | ... | |
100 | 100 |
} |
101 | 101 |
|
102 | 102 |
} catch ( RemoteException re) { |
103 |
throw new ConnectException(re.getMessage()); |
|
103 |
throw new ConnectException("Error in AuthMcat.authenticate: " + |
|
104 |
re.getMessage()); |
|
104 | 105 |
} |
105 | 106 |
|
106 | 107 |
return false; |
... | ... | |
125 | 126 |
} |
126 | 127 |
|
127 | 128 |
} catch ( RemoteException re) { |
128 |
throw new ConnectException(re.getMessage()); |
|
129 |
throw new ConnectException("Error in AuthMcat.getUsers " + |
|
130 |
re.getMessage()); |
|
129 | 131 |
} |
130 | 132 |
|
131 | 133 |
return null; |
... | ... | |
149 | 151 |
} |
150 | 152 |
|
151 | 153 |
} catch ( RemoteException re) { |
152 |
throw new ConnectException(re.getMessage()); |
|
154 |
throw new ConnectException("Error in AuthMcat.getUsers: " + |
|
155 |
re.getMessage()); |
|
153 | 156 |
} |
154 | 157 |
|
155 | 158 |
return null; |
... | ... | |
173 | 176 |
} |
174 | 177 |
|
175 | 178 |
} catch ( RemoteException re) { |
176 |
throw new ConnectException(re.getMessage()); |
|
179 |
throw new ConnectException("Error in authMcat.getGroups: " + |
|
180 |
re.getMessage()); |
|
177 | 181 |
} |
178 | 182 |
|
179 | 183 |
return null; |
... | ... | |
197 | 201 |
} |
198 | 202 |
|
199 | 203 |
} catch ( RemoteException re) { |
200 |
throw new ConnectException(re.getMessage()); |
|
204 |
throw new ConnectException("Error in AuthMcat.getGroupds: " + |
|
205 |
re.getMessage()); |
|
201 | 206 |
} |
202 | 207 |
|
203 | 208 |
return null; |
src/edu/ucsb/nceas/metacat/ReplicationHandler.java | ||
---|---|---|
140 | 140 |
responses.add(result); |
141 | 141 |
} |
142 | 142 |
|
143 |
//System.out.println("responses: " + responses.toString());
|
|
143 |
//String srvr = util.getOption("servletpath");
|
|
144 | 144 |
|
145 |
//System.out.println("responses (from srvr): " + responses.toString()); |
|
146 |
|
|
145 | 147 |
for(int i=0; i<responses.size(); i++) |
146 | 148 |
{ //check each server for updated files |
147 | 149 |
//System.out.println("parsing responses"); |
... | ... | |
224 | 226 |
} |
225 | 227 |
catch(Exception e) |
226 | 228 |
{ |
227 |
System.out.println("error writing document " + docid); |
|
229 |
System.out.println("error writing document in " + |
|
230 |
"ReplicationHandler.update: " + docid + |
|
231 |
": " + e.getMessage()); |
|
228 | 232 |
} |
229 | 233 |
} |
230 | 234 |
} |
... | ... | |
264 | 268 |
} |
265 | 269 |
catch(Exception e) |
266 | 270 |
{ |
267 |
System.out.println("error in update2: " + e.getMessage()); |
|
271 |
System.out.println("error in ReplicationHandler.update: " + |
|
272 |
e.getMessage()); |
|
268 | 273 |
e.printStackTrace(System.out); |
269 | 274 |
} |
270 | 275 |
finally |
... | ... | |
282 | 287 |
*/ |
283 | 288 |
private void updateCatalog(Hashtable serverList, Connection conn) |
284 | 289 |
{ |
285 |
System.out.println("in updateCatalog"); |
|
286 | 290 |
try |
287 | 291 |
{ |
288 | 292 |
String server; |
... | ... | |
351 | 355 |
} |
352 | 356 |
catch(Exception e) |
353 | 357 |
{ |
354 |
System.out.println("error in updateCatalog: " + e.getMessage()); |
|
358 |
System.out.println("error in ReplicationHandler.updateCatalog: " + |
|
359 |
e.getMessage()); |
|
355 | 360 |
e.printStackTrace(System.out); |
356 | 361 |
} |
357 | 362 |
} |
... | ... | |
419 | 424 |
} |
420 | 425 |
catch(Exception e) |
421 | 426 |
{ |
422 |
System.out.println("error in alreadyDeleted: " + e.getMessage()); |
|
427 |
System.out.println("error in ReplicationHandler.alreadyDeleted: " + |
|
428 |
e.getMessage()); |
|
423 | 429 |
e.printStackTrace(System.out); |
424 | 430 |
} |
425 | 431 |
finally |
src/edu/ucsb/nceas/metacat/DBSAXNode.java | ||
---|---|---|
143 | 143 |
} |
144 | 144 |
|
145 | 145 |
} catch (SQLException e) { |
146 |
System.out.println("Error in DBSaxNode.writeChildNodeToDB"); |
|
146 | 147 |
System.err.println("Error inserting node: (" + nodetype + ", " + |
147 | 148 |
nodename + ", " + |
148 | 149 |
data + ")" ); |
... | ... | |
169 | 170 |
pstmt.execute(); |
170 | 171 |
pstmt.close(); |
171 | 172 |
} catch (SQLException e) { |
172 |
System.out.println(e.getMessage()); |
|
173 |
System.out.println("Error in DBSaxNode.writeNodeName: " + |
|
174 |
e.getMessage()); |
|
173 | 175 |
throw new SAXException(e.getMessage()); |
174 | 176 |
} |
175 | 177 |
} |
... | ... | |
188 | 190 |
} |
189 | 191 |
stmt.close(); |
190 | 192 |
} catch (SQLException e) { |
191 |
System.out.println("Error getting id: " + e.getMessage()); |
|
193 |
System.out.println("Error in DBSaxNode.generateNodeID: " + |
|
194 |
e.getMessage()); |
|
192 | 195 |
throw new SAXException(e.getMessage()); |
193 | 196 |
} |
194 | 197 |
|
... | ... | |
281 | 284 |
// Close the database statement |
282 | 285 |
pstmt.close(); |
283 | 286 |
} catch (SQLException sqe) { |
284 |
System.err.println("SQL Exception while inserting path to index."); |
|
287 |
System.err.println("SQL Exception while inserting path to index in " + |
|
288 |
"DBSAXNode.updateNodeIndex"); |
|
285 | 289 |
System.err.println(sqe.getMessage()); |
286 | 290 |
throw new SAXException(sqe.getMessage()); |
287 | 291 |
} |
... | ... | |
358 | 362 |
// Close the database statement |
359 | 363 |
pstmt.close(); |
360 | 364 |
} catch (SQLException sqe) { |
361 |
System.err.println("SQL Exception while inserting path to index."); |
|
365 |
System.err.println("SQL Exception while inserting path to index in " + |
|
366 |
"DBSAXNode.updateNodeIndex"); |
|
362 | 367 |
System.err.println(sqe.getMessage()); |
363 | 368 |
throw new SAXException(sqe.getMessage()); |
364 | 369 |
} |
src/edu/ucsb/nceas/metacat/RelationHandler.java | ||
---|---|---|
47 | 47 |
} |
48 | 48 |
catch(Exception e) |
49 | 49 |
{ |
50 |
System.out.println("error opening connection in relationHandler"); |
|
50 |
System.out.println("error opening connection in " + |
|
51 |
"relationHandler.relationHandler: " + e.getMessage()); |
|
51 | 52 |
} |
52 | 53 |
|
53 | 54 |
this.xmldoc = xmldoc; |
... | ... | |
226 | 227 |
conn.rollback(); |
227 | 228 |
} |
228 | 229 |
catch (SQLException sqle) {} |
229 |
System.out.println("Error in relationHandler: " + e.getMessage()); |
|
230 |
util.debugMessage("Error in relationHandler: " + e.getMessage()); |
|
230 |
System.out.println("Error in relationHandler.run: " + e.getMessage());
|
|
231 |
util.debugMessage("Error in relationHandler.run: " + e.getMessage());
|
|
231 | 232 |
e.printStackTrace(System.out); |
232 | 233 |
btThread = null; |
233 | 234 |
} |
... | ... | |
253 | 254 |
conn.rollback(); |
254 | 255 |
} |
255 | 256 |
catch (SQLException sqle) {} |
256 |
System.out.println("error in deleteRelations(): " + e.getMessage()); |
|
257 |
System.out.println("error in RelationHandler.deleteRelations(): " + |
|
258 |
e.getMessage()); |
|
257 | 259 |
e.printStackTrace(System.out); |
258 | 260 |
} |
259 | 261 |
|
src/edu/ucsb/nceas/metacat/DocumentIdentifier.java | ||
---|---|---|
131 | 131 |
} |
132 | 132 |
catch(Exception e2) |
133 | 133 |
{} |
134 |
System.out.println("error in DocumentIdentifier.getNewestRev " + |
|
134 |
System.out.println("error closing db connection in " + |
|
135 |
"DocumentIdentifier.getNewestRev " + |
|
135 | 136 |
e.getMessage()); |
136 | 137 |
} |
137 | 138 |
return "1"; |
src/edu/ucsb/nceas/metacat/DBUtil.java | ||
---|---|---|
81 | 81 |
} |
82 | 82 |
|
83 | 83 |
} catch (Exception e) { |
84 |
System.err.println("EXCEPTION HANDLING REQUIRED");
|
|
84 |
System.err.println("error in DBUtil.main");
|
|
85 | 85 |
System.err.println(e.getMessage()); |
86 | 86 |
e.printStackTrace(System.err); |
87 | 87 |
} |
src/edu/ucsb/nceas/metacat/DataStreamTest.java | ||
---|---|---|
73 | 73 |
} |
74 | 74 |
catch (UnknownHostException e) |
75 | 75 |
{ |
76 |
System.err.println("Don't know about host: " + host); |
|
77 |
System.out.println("error: " + e.getMessage()); |
|
76 |
System.err.println("Don't know about host: " + host + |
|
77 |
" : error in DataStreamTest.sendFile: " + |
|
78 |
e.getMessage()); |
|
78 | 79 |
e.printStackTrace(System.out); |
79 | 80 |
System.exit(1); |
80 | 81 |
} |
81 | 82 |
catch (IOException e) |
82 | 83 |
{ |
83 |
System.err.println("Couldn't get I/O for "
|
|
84 |
+ "the connection to: " + host);
|
|
84 |
System.err.println("IO error in DataStreamTest.sendFile: "
|
|
85 |
+ "broken connection to: " + host);
|
|
85 | 86 |
System.out.println("error: " + e.getMessage()); |
86 | 87 |
e.printStackTrace(System.out); |
87 | 88 |
System.exit(1); |
... | ... | |
148 | 149 |
} |
149 | 150 |
catch (Exception w) |
150 | 151 |
{ |
151 |
System.out.println("error in DataStreamTest: " + w.getMessage()); |
|
152 |
System.out.println("error in DataStreamTest.sendFile: " + w.getMessage());
|
|
152 | 153 |
} |
153 | 154 |
|
154 | 155 |
try |
... | ... | |
173 | 174 |
} |
174 | 175 |
catch(Exception e) |
175 | 176 |
{ |
176 |
System.out.println("error: " + e.getMessage()); |
|
177 |
System.out.println("error in DataStreamTest.sendFile: " + e.getMessage());
|
|
177 | 178 |
} |
178 | 179 |
return retmsg; |
179 | 180 |
} |
src/edu/ucsb/nceas/metacat/DBSimpleQuery.java | ||
---|---|---|
100 | 100 |
System.out.println(result); |
101 | 101 |
|
102 | 102 |
} catch (Exception e) { |
103 |
System.err.println("EXCEPTION HANDLING REQUIRED");
|
|
103 |
System.err.println("Error in DBSimpleQuery.main");
|
|
104 | 104 |
System.err.println(e.getMessage()); |
105 | 105 |
e.printStackTrace(System.err); |
106 | 106 |
} |
... | ... | |
207 | 207 |
} |
208 | 208 |
pstmt.close(); |
209 | 209 |
} catch (SQLException e) { |
210 |
System.out.println("Error getting id: " + e.getMessage()); |
|
210 |
System.out.println("Error in DBSimpleQuery.findDocuments: " + |
|
211 |
e.getMessage()); |
|
211 | 212 |
} |
212 | 213 |
|
213 | 214 |
return docListResult; |
src/edu/ucsb/nceas/metacat/ForceReplicationHandler.java | ||
---|---|---|
127 | 127 |
} |
128 | 128 |
catch(Exception e) |
129 | 129 |
{ |
130 |
System.out.println("error in ForceReplicationHandler: " + e.getMessage()); |
|
130 |
System.out.println("error in ForceReplicationHandler.run: " + |
|
131 |
e.getMessage()); |
|
131 | 132 |
e.printStackTrace(System.out); |
132 | 133 |
} |
133 | 134 |
MetaCatUtil.debugMessage("exiting ForceReplicationHandler Thread"); |
Also available in: Unified diff
added precise location information (class.method) to each catch statement so that errors are more easily traced.