package com.asksunny.app;

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

public class AppBooststrap {

	public AppBooststrap() {
	}

	public static void main(String[] args) {
		AbstractApplicationContext appContext = null;
		try {
			appContext = new ClassPathXmlApplicationContext(new String[] { "server-app-context.xml" });
		} catch (BeansException e) {
			if (appContext != null) {
				appContext.close();
			}
			e.printStackTrace();
			System.exit(1);
		}
	}

}

@@ -329,16 +329,384 @@
 args) %7B%0D
+%0A%0D%0A%09%09/**%0D%0A%09%09 * Doing try catch here is very important, especially spring framwork is%0D%0A%09%09 * used to launch service service We would like to catch all startup%0D%0A%09%09 * exception and stop the service if bean exception is every happened;%0D%0A%09%09 * this way it would prevent unexpected behavior during the running; it%0D%0A%09%09 * also force developer to handle exception nicely.%0D%0A%09%09 */%0D
 %0A%09%09Abstr

Add comment