Revision 675
Added by berkley over 23 years ago
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 |
|
Also available in: Unified diff
added precise location information (class.method) to each catch statement so that errors are more easily traced.