package com.dgrid.driver;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public abstract class BaseDgridDriver {

	protected static AbstractApplicationContext getContext() throws Exception {
		String[] paths = new String[] { "/applicationContext.xml",
				"/applicationContext-hibernate.xml" };
		AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
				paths);
		return ctx;
	}
}

@@ -20,16 +20,123 @@
 river;%0A%0A
+import java.io.File;%0A%0Aimport org.apache.commons.logging.Log;%0Aimport org.apache.commons.logging.LogFactory;%0A
 import o
@@ -277,260 +277,1051 @@
 xt;%0A
-%0Apublic abstract class BaseDgridDriver %7B%0A%0A%09protected static AbstractApplicationContext getContext() throws Exception %7B%0A%09%09String%5B%5D paths = new String%5B%5D %7B %22/applicationContext.xml%22,%0A%09%09%09%09%22/applicationContext-hibernate.xml%22 %7D;%0A%09%09AbstractApplicationContext 
+import org.springframework.context.support.FileSystemXmlApplicationContext;%0A%0Apublic abstract class BaseDgridDriver %7B%0A%09private static String%5B%5D defaultSpringPaths = new String%5B%5D %7B%0A%09%09%09%22/applicationContext.xml%22, %22/applicationContext-hibernate.xml%22 %7D;%0A%0A%09private static Log log = LogFactory.getLog(BaseDgridDriver.class);%0A%0A%09protected static AbstractApplicationContext getContext() %7B%0A%09%09AbstractApplicationContext ctx = null;%0A%09%09String springConfig = System.getProperty(%22spring.config%22);%0A%09%09if ((springConfig != null) && (springConfig.length() %3E 0)) %7B%0A%09%09%09File file = new File(springConfig);%0A%09%09%09if (file.exists() && file.canRead()) %7B%0A%09%09%09%09if (log.isDebugEnabled()) %7B%0A%09%09%09%09%09log.debug(String.format(%0A%09%09%09%09%09%09%09%22Loading spring context from file %251$s%22,%0A%09%09%09%09%09%09%09springConfig));%0A%09%09%09%09%7D%0A%09%09%09%09ctx = new FileSystemXmlApplicationContext(springConfig);%0A%09%09%09%7D else %7B%0A%09%09%09%09log%0A%09%09%09%09%09%09.warn(String%0A%09%09%09%09%09%09%09%09.format(%0A%09%09%09%09%09%09%09%09%09%09%22Attempt to load spring context from non-existent or non-readable file %251$s. Using defaults.%22,%0A%09%09%09%09%09%09%09%09%09%09springConfig));%0A%09%09%09%7D%0A%09%09%7D%0A%09%09if (ctx == null) %7B%0A%09%09%09
 ctx 
@@ -1361,21 +1361,33 @@
 ext(
-%0A%09%09%09%09p
+defaultSpringP
 aths);%0A
+%09%09%7D%0A
 %09%09re

add jvm arg spring.config to override default spring config file