import java.util.Properties;\r
import java.util.Vector;\r
\r
-import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;\r
-import org.springframework.context.ApplicationContext;\r
+import org.springframework.context.support.AbstractApplicationContext;\r
import org.springframework.context.support.FileSystemXmlApplicationContext;\r
\r
import org.apache.commons.logging.Log;\r
* application context and a structure registry with the Ant project.\r
*/\r
public class SlcProjectHelper extends ProjectHelperImpl {\r
- private static Log log = LogFactory.getLog(SlcProjectHelper.class);\r
+ private static Log log ;\r
\r
public static String REF_ROOT_CONTEXT = "slcApplicationContext";\r
public static String REF_STRUCTURE_REGISTRY = "slcStructureRegistry";\r
\r
@Override\r
public void parse(Project project, Object source) throws BuildException {\r
- log.debug("Entered SLC project helper");\r
\r
// look for root file\r
File projectBaseDir = project.getBaseDir();\r
throw new SlcAntException("Cannot find SLC root file");\r
}\r
SlcAntConfig.initProject(project, slcRootFile);\r
+ \r
+ if(log == null){\r
+ // log4j is initialized only now\r
+ log = LogFactory.getLog(SlcProjectHelper.class);\r
+ }\r
+ log.debug("SLC properties are set, starting initialization..");\r
\r
// init Spring application context\r
initSpringContext(project);\r
System.getProperties().putAll(project.getProperties());\r
String acPath = project\r
.getUserProperty(SlcAntConfig.APPLICATION_CONTEXT_PROPERTY);\r
- ApplicationContext context = new FileSystemXmlApplicationContext(acPath);\r
+ AbstractApplicationContext context = new FileSystemXmlApplicationContext(acPath);\r
+ context.registerShutdownHook();\r
project.addReference(REF_ROOT_CONTEXT, context);\r
}\r
\r