package com.feng.main;
import java.util.concurrent.Semaphore;
import org.springframework.web.context.support.XmlWebApplicationContext;
public class ServerMain {
public static void main(String[] args) throws InterruptedException {
Semaphore sp = new Semaphore(0);
@SuppressWarnings("resource")
XmlWebApplicationContext applicationContext = new XmlWebApplicationContext();
applicationContext.setConfigLocation("classpath:spring-context.xml");
applicationContext.refresh();
applicationContext.start();
applicationContext.registerShutdownHook();
sp.acquire();
System.out.println("微服务启动成功。");
}
}