Thursday, April 17, 2014

Spring with Log4j Initialization

import org.apache.log4j.BasicConfigurator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class zzZZMain {
    private static ApplicationContext context = null;
    static {
        BasicConfigurator.configure();
        context = new ClassPathXmlApplicationContext("classpath*:com/jini/TESTING/application*.xml");
        }
    public static Object getBean(String beanName) {
        return context.getBean(beanName);
    }
    public static void main(String[] args) throws Exception {
        System.out.println("--------- SpRiNg and lOg4j iNiTiaLiZaTion successfull --------");
    } // end of main()
} // end of class