Index: test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestDetailLogTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestDetailLogTest.java	(revision 4998)
+++ test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestDetailLogTest.java	(revision 4999)
@@ -79,6 +79,7 @@
    */
   protected void setUp() {
     Connection conn;
+    boolean commandLineMode = true;
     String contactEmail = "jdoe@institution.edu";
     String dateLastHarvest = "2004-04-01 00:00:00.0";
     String dateNextHarvest = "2004-05-01 00:00:00.0";
@@ -101,7 +102,7 @@
     int updateFrequency = 1;
   
     harvester = new Harvester();
-    Harvester.loadProperties(test);
+    Harvester.loadProperties(commandLineMode, test);
     conn = harvester.getConnection();  // initializes the database connection
     harvester.initLogIDs();
     harvestLogID = harvester.getHarvestLogID();
Index: test/edu/ucsb/nceas/metacattest/harvesterClient/HarvesterTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/harvesterClient/HarvesterTest.java	(revision 4998)
+++ test/edu/ucsb/nceas/metacattest/harvesterClient/HarvesterTest.java	(revision 4999)
@@ -107,10 +107,11 @@
 	 * Tests loading of Harvester properties from a configuration file.
 	 */
 	public void testLoadProperties() {
+	    boolean commandLineMode = true;
 		String ctm = null;
 		boolean test = true;
 
-		Harvester.loadProperties(test);
+		Harvester.loadProperties(commandLineMode, test);
 		try {
 			ctm = PropertyService.getProperty("harvester.connectToMetacat");
 		} catch (PropertyNotFoundException pnfe) {
Index: test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestDocumentTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestDocumentTest.java	(revision 4998)
+++ test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestDocumentTest.java	(revision 4999)
@@ -77,6 +77,7 @@
    * objects.
    */
   protected void setUp() {
+    boolean commandLineMode = true;
     String contactEmail = "jdoe@institution.edu";
     String dateLastHarvest = "2004-04-01 00:00:00.0";
     String dateNextHarvest = "2004-05-01 00:00:00.0";
@@ -103,7 +104,7 @@
     int updateFrequency = 1;
 
     harvester = new Harvester();
-    Harvester.loadProperties(test);
+    Harvester.loadProperties(commandLineMode, test);
     harvester.getConnection();  // initializes the database connection
     harvester.initLogIDs();
     harvester.setHarvestStartTime(new Date());
Index: test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestLogTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestLogTest.java	(revision 4998)
+++ test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestLogTest.java	(revision 4999)
@@ -83,6 +83,7 @@
    * HarvestLog that does have an associated HarvestDetailLog.
    */
   protected void setUp() {
+    boolean commandLineMode = true;
     String contactEmail = "jdoe@institution.edu";
     String dateLastHarvest = "2004-04-01 00:00:00.0";
     String dateNextHarvest = "2004-05-01 00:00:00.0";
@@ -110,7 +111,7 @@
     int updateFrequency = 1;
 
     harvester = new Harvester();
-    Harvester.loadProperties(test);
+    Harvester.loadProperties(commandLineMode, test);
     conn = harvester.getConnection();  // initializes the database connection
     harvester.initLogIDs();
     harvestLogID = harvester.getHarvestLogID();
Index: test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestSiteScheduleTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestSiteScheduleTest.java	(revision 4998)
+++ test/edu/ucsb/nceas/metacattest/harvesterClient/HarvestSiteScheduleTest.java	(revision 4999)
@@ -79,6 +79,7 @@
    * with a past date of next harvest (is due for harvest now).
    */
   protected void setUp() {
+    boolean commandLineMode = true;
     String contactEmail = "jdoe@institution.edu";
     String dateLastHarvest = "2004-04-01 00:00:00.0";
     String dateNextHarvestFuture = "2056-01-01 00:00:00.0";
@@ -94,7 +95,7 @@
     int updateFrequency = 1;
 
     harvester = new Harvester();
-    Harvester.loadProperties(test);
+    Harvester.loadProperties(commandLineMode, test);
     harvester.getConnection();  // initializes the database connection
     harvester.initLogIDs();
     harvester.setHarvestStartTime(new Date());
Index: lib/harvester/runHarvester.sh
===================================================================
--- lib/harvester/runHarvester.sh	(revision 4998)
+++ lib/harvester/runHarvester.sh	(revision 4999)
@@ -1,7 +1,7 @@
 METACAT_CLASSES=$METACAT_HOME/build/classes
 METACAT_LIB=$METACAT_HOME/lib
-JDBC=$METACAT_HOME/build/war/lib/jdbc.jar
-LIB_JARS=$METACAT_LIB/cos.jar:$METACAT_LIB/xercesImpl.jar:$METACAT_LIB/utilities.jar
+JDBC=$METACAT_HOME/build/war/lib/jdbc.jar:$METACAT_LIB/postgresql-8.0-312.jdbc3.jar
+LIB_JARS=$METACAT_LIB/cos.jar:$METACAT_LIB/xercesImpl.jar:$METACAT_LIB/utilities.jar:$METACAT_LIB/log4j-1.2.12.jar:$METACAT_LIB/xalan.jar
 export CLASSPATH=$METACAT_CLASSES:$JDBC:$LIB_JARS
 cd $METACAT_CLASSES
 java edu.ucsb.nceas.metacat.harvesterClient.Harvester
Index: lib/harvester/runHarvester.bat
===================================================================
--- lib/harvester/runHarvester.bat	(revision 4998)
+++ lib/harvester/runHarvester.bat	(revision 4999)
@@ -1,8 +1,9 @@
 echo off
 set METACAT_CLASSES=%METACAT_HOME%\build\classes
 set METACAT_LIB=%METACAT_HOME%\lib
-set JDBC=%METACAT_HOME%\build\war\lib\jdbc.jar
-set LIB_JARS=%METACAT_LIB%\cos.jar;%METACAT_LIB%\xercesImpl.jar;%METACAT_LIB%\utilities.jar
+set LOG4J_PATH=%METACAT_HOME%\build\war\WEB-INF\log4j.properties
+set JDBC=%METACAT_HOME%\build\war\lib\jdbc.jar;%METACAT_LIB%\postgresql-8.0-312.jdbc3.jar
+set LIB_JARS=%METACAT_LIB%\cos.jar;%METACAT_LIB%\xercesImpl.jar;%METACAT_LIB%\utilities.jar;%METACAT_LIB%\log4j-1.2.12.jar;%METACAT_LIB%\xalan.jar
 set CLASSPATH=%METACAT_CLASSES%;%JDBC%;%LIB_JARS%
 cd %METACAT_CLASSES%
-java edu.ucsb.nceas.metacat.harvesterClient.Harvester
+java -Dlog4j.configuration=%LOG4J_PATH% edu.ucsb.nceas.metacat.harvesterClient.Harvester
Index: src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java
===================================================================
--- src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java	(revision 4998)
+++ src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java	(revision 4999)
@@ -37,6 +37,8 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
 
 import edu.ucsb.nceas.metacat.client.Metacat;
 import edu.ucsb.nceas.metacat.client.MetacatFactory;
@@ -61,6 +63,7 @@
   private static final String CONFIG_DIR = "../../build/war/WEB-INF";
   private static final String CONFIG_DIR_TEST = "./build/war/WEB-INF";
 //  private static final String CONFIG_NAME = "metacat.properties";
+  private static final String LOG_CONFIG_NAME = "../../build/war/WEB-INF/log4j.properties";
   public static final String filler = "*";
   private static boolean keepRunning = true;
   public static final String marker =
@@ -84,11 +87,16 @@
   /**
    * Loads Harvester options from a configuration file.
    */
-  public static void loadProperties(boolean test) {
+  public static void loadProperties(boolean commandLineMode, boolean test) {
     String configDir = test ? CONFIG_DIR_TEST : CONFIG_DIR;    
 
     try {
-    	PropertyService.getInstance();
+      if (commandLineMode) {
+        PropertyService.getTestInstance(configDir);
+      }
+      else {
+        PropertyService.getInstance();
+      }
     } 
     catch (ServiceException e) {
       System.out.println("Error in loading properties: " + e.getMessage());
@@ -99,14 +107,23 @@
     /**
 	 * Harvester main method.
 	 * 
-	 * @param args
-	 *            the command line arguments
+	 * @param args               the command line arguments
+	 * 
+	 *   args[0] if "false", then this is not command-line mode,
+	 *           Command-line mode is true by default.
+	 *           
+	 *   args[1] if present, represents the path to the harvest list schema file.
+	 *           Specifying it overrides the default path to the schema file.
+	 *   
 	 * @throws SAXException
 	 * @throws IOException
 	 * @throws ParserConfigurationException
 	 */
 	public static void main(String[] args) {
-		Integer delayDefault = new Integer(0); // Default number of hours delay
+	    boolean commandLineMode = true;
+	    boolean test = false;   // set to true for JUnit testing
+
+	    Integer delayDefault = new Integer(0); // Default number of hours delay
 		int delay = delayDefault.intValue(); // Delay in hours before first
 												// harvest
 		Integer d; // Used for determining delay
@@ -124,10 +141,22 @@
 		int period = periodDefault.intValue(); // Hours between harvests
 		Integer p; // Used in determining the period
 		long startTime; // time that a harvest run starts
-		boolean test = false; // Passed to loadOption()
+		
+		if ((args.length > 0) && (args[0] != null)) {
+		  if (args[0].equals("false")) {
+		    commandLineMode = false;
+		  }
+		  else {
+		    // If commandLineMode is true, initialize log4j properties
+	        PropertyConfigurator.configureAndWatch(LOG_CONFIG_NAME);
+		  }
+		}
 
-		if (args.length > 0) {
-			schemaLocation = args[0];
+		/*
+		 * If there is a second argument, it is the schemaLocation value
+		 */
+		if (args.length > 1) {
+			schemaLocation = args[1];
 			System.err.println("schemaLocation: " + schemaLocation);
 
 			try {
@@ -139,7 +168,7 @@
 
 		System.out.println(marker);
 		System.out.println("Starting Harvester");
-		Harvester.loadProperties(test);
+		Harvester.loadProperties(commandLineMode, test);
 
 		// Parse the delay property. Use default if necessary.
 		try {
Index: src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterServlet.java	(revision 4998)
+++ src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterServlet.java	(revision 4999)
@@ -83,8 +83,9 @@
    * 30 seconds to give Metacat a chance to fully initialize.
    */
   public void run() {
-      String[] args = new String[1];
-      args[0] = SCHEMA_LOCATION;
+      String[] args = new String[2];
+      args[0] = "false";     // Set to true if in command line mode or test mode
+      args[1] = SCHEMA_LOCATION;
 
       try {
         Thread.sleep(30000);    // Sleep 30 seconds before starting Harvester
Index: src/edu/ucsb/nceas/metacat/harvesterClient/HarvestSiteSchedule.java
===================================================================
--- src/edu/ucsb/nceas/metacat/harvesterClient/HarvestSiteSchedule.java	(revision 4998)
+++ src/edu/ucsb/nceas/metacat/harvesterClient/HarvestSiteSchedule.java	(revision 4999)
@@ -337,6 +337,13 @@
                             null,
                             "");
       inputStreamReader = new InputStreamReader(inputStream);
+      char[] harvestListChars = new char[1024];
+      inputStreamReader.read(harvestListChars, 0, 1024);
+      System.out.println("documentListURL: " + documentListURL);
+      String encoding = inputStreamReader.getEncoding();
+      System.out.println("encoding: " + encoding);
+      String harvestListStr = new String(harvestListChars);
+      System.out.println("harvestListStr:\n" + harvestListStr);
       documentListHandler.runParser(inputStreamReader, schemaLocation);
       harvester.addLogEntry(0,
                             "Validated: " + documentListURL,
