Project

General

Profile

« Previous | Next » 

Revision 4661

Added by daigle over 15 years ago

Add debug statements

View differences:

src/edu/ucsb/nceas/metacat/DocumentImpl.java
2561 2561
                     * XMLReader parser = initializeParser(conn, action, docid,
2562 2562
                     * updaterev, validate, user, groups, pub, serverCode, dtd);
2563 2563
                     */
2564
                    logMetacat.debug("initializing parser");
2564 2565
                    parser = initializeParser(conn, action, docid, xml, updaterev,
2565 2566
                            user, groups, pub, serverCode, dtd, ruleBase,
2566 2567
                            needValidation, false, null, null);// false means it is not a revision doc
2567 2568
                                   //null, null are createdate and updatedate
2568 2569
                                   //null will use current time as create date time
2569 2570
                    conn.setAutoCommit(false);
2571
                    logMetacat.debug("parsing xml");
2570 2572
                    parser.parse(new InputSource(xml));
2571 2573
                    conn.commit();
2572 2574
                    conn.setAutoCommit(true);
2573 2575
                    
2574 2576
                    //write the file to disk
2577
                    logMetacat.debug("Writing xml to file system");
2575 2578
                	writeToFileSystem(xmlString, accnum);
2576 2579

  
2577 2580
                    // write to xml_node complete. start the indexing thread.
2578 2581
                    addDocidToIndexingQueue(docid, rev);
2579 2582
               } catch (Exception e) {
2583
            	   logMetacat.error("Problem with parsing: " + e.getMessage());
2580 2584
                    conn.rollback();
2581 2585
                    conn.setAutoCommit(true);
2582 2586
                    //if it is a eml2 document, we need delete online data
......
2653 2657

  
2654 2658
            addDocidToIndexingQueue(docid, rev);
2655 2659
        } catch (Exception e) {
2660
        	logMetacat.error("Problem with parsing: " + e.getMessage());
2656 2661
            e.printStackTrace();
2657 2662
            conn.rollback();
2658 2663
            conn.setAutoCommit(true);
......
2835 2840
            catalogId = dbx.getCatalogId();
2836 2841

  
2837 2842
        } catch (Exception e) {
2843
        	logMetacat.error("Problem with parsing: " + e.getMessage());
2838 2844
            conn.rollback();
2839 2845
            conn.setAutoCommit(true);
2840 2846
            if (parser != null) {
......
3317 3323
            String parserName = PropertyService.getProperty("xml.saxparser");
3318 3324
            parser = XMLReaderFactory.createXMLReader(parserName);
3319 3325
            if (ruleBase != null && ruleBase.equals(EML200)) {
3320
                logMetacat.warn("Using eml 2.0.0 parser");
3326
                logMetacat.debug("Using eml 2.0.0 parser");
3321 3327
                chandler = new Eml200SAXHandler(dbconn, action, docid, rev,
3322 3328
                        user, groups, pub, serverCode, createDate, updateDate);
3323 3329
                chandler.setIsRevisionDoc(isRevision);
......
3334 3340
                String externalSchemaLocation = null;
3335 3341
//                SchemaLocationResolver resolver = new SchemaLocationResolver();
3336 3342
                externalSchemaLocation = XMLSchemaService.getNameSpaceAndLocationString();
3343
                logMetacat.debug("2.0.0 external schema location: " + externalSchemaLocation);
3337 3344
                // Set external schemalocation.
3338 3345
                if (externalSchemaLocation != null
3339 3346
                        && !(externalSchemaLocation.trim()).equals("")) {
3340 3347
                    parser.setProperty(EXTERNALSCHEMALOCATIONPROPERTY,
3341 3348
                            externalSchemaLocation);
3342 3349
                }
3350
                logMetacat.debug("2.0.0 parser configured");
3343 3351
            } else if (ruleBase != null && ruleBase.equals(EML210)) {
3344
                logMetacat.warn("Using eml 2.1.0 parser");
3352
                logMetacat.debug("Using eml 2.1.0 parser");
3345 3353
                chandler = new Eml210SAXHandler(dbconn, action, docid, rev,
3346 3354
                        user, groups, pub, serverCode, createDate, updateDate);
3347 3355
                chandler.setIsRevisionDoc(isRevision);
......
3357 3365
                // From DB to find the register external schema location
3358 3366
                String externalSchemaLocation = null;
3359 3367
                externalSchemaLocation = XMLSchemaService.getNameSpaceAndLocationString();
3368
                logMetacat.debug("2.1.0 external schema location: " + externalSchemaLocation);
3360 3369
                // Set external schemalocation.
3361 3370
                if (externalSchemaLocation != null
3362 3371
                        && !(externalSchemaLocation.trim()).equals("")) {
3363 3372
                    parser.setProperty(EXTERNALSCHEMALOCATIONPROPERTY,
3364 3373
                            externalSchemaLocation);
3365 3374
                }
3375
                logMetacat.debug("Using eml 2.1.0 parser configured");
3366 3376
            } else {
3367 3377
                //create a DBSAXHandler object which has the revision
3368 3378
                // specification
......
3392 3402
                    // From DB to find the register external schema location
3393 3403
                    String externalSchemaLocation = null;
3394 3404
                    externalSchemaLocation = XMLSchemaService.getNameSpaceAndLocationString();
3405
                    logMetacat.debug("Generic external schema location: " + externalSchemaLocation);              
3395 3406
                    // Set external schemalocation.
3396 3407
                    if (externalSchemaLocation != null
3397 3408
                            && !(externalSchemaLocation.trim()).equals("")) {
src/edu/ucsb/nceas/metacat/DBSAXNode.java
199 199
        }
200 200
      }
201 201
      // Do the insertion
202
      logMetacat.debug("SQL insert: " + pstmt.toString());
202 203
      pstmt.execute();
203 204
      pstmt.close();
204 205

  
......
223 224
      }
224 225

  
225 226
    } catch (SQLException e) {
226
      System.out.println("Error in DBSaxNode.writeChildNodeToDB");
227
      System.err.println("Error inserting node: (" + nodetype + ", " +
227
      logMetacat.error("Error in DBSaxNode.writeChildNodeToDB");
228
      logMetacat.error("Error inserting node: (" + nodetype + ", " +
228 229
                                                     nodename + ", " +
229 230
                                                     data + ")" );
230
      System.err.println(e.getMessage());
231
      logMetacat.error(e.getMessage());
231 232
      e.printStackTrace(System.err);
232 233
      throw new SAXException(e.getMessage());
233 234
    }
src/edu/ucsb/nceas/metacat/Eml200SAXHandler.java
353 353
        }
354 354
        catch (Exception e)
355 355
        {
356
            logMetacat.error("erorr in Eml200SAXHanlder is "
357
                                     +e.getMessage());
356
            logMetacat.error("error in Eml200SAXHandler is " + e.getMessage());
358 357
            throw new SAXException(e.getMessage());
359 358
        }
360 359
    }

Also available in: Unified diff