| package com.xzx.gc; | 
|   | 
| import com.twelvemonkeys.servlet.image.IIOProviderContextListener; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.boot.SpringApplication; | 
| import org.springframework.boot.autoconfigure.SpringBootApplication; | 
| import org.springframework.boot.builder.SpringApplicationBuilder; | 
| import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | 
| import org.springframework.scheduling.annotation.EnableAsync; | 
| import org.springframework.scheduling.annotation.EnableScheduling; | 
| import tk.mybatis.spring.annotation.MapperScan; | 
|   | 
| import javax.servlet.ServletContext; | 
| import javax.servlet.ServletException; | 
|   | 
| @EnableAsync | 
| @EnableScheduling | 
| @MapperScan({"com.xzx.gc.*.mapper"}) | 
| @SpringBootApplication | 
| @Slf4j | 
| public class GcUserApplication extends SpringBootServletInitializer{ | 
|   | 
|   | 
|     @Override | 
|     protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { | 
|         return application.sources(GcUserApplication.class); | 
|     } | 
|   | 
|     public static void main(String[] args) { | 
|         SpringApplication.run(GcUserApplication.class, args); | 
|     } | 
|   | 
|   | 
|     @Override | 
|     public void onStartup(ServletContext servletContext) throws ServletException { | 
|         //解决ImageIO类被覆盖的问题 | 
|         servletContext.addListener(IIOProviderContextListener.class); | 
|         super.onStartup(servletContext); | 
|     } | 
| } |