瀏覽代碼

打包后,启动不了

chenyongxing 6 年之前
父節點
當前提交
336e45510a
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8 4
      src/main/java/com/yihu/hos/HosAdminApplication.java

+ 8 - 4
src/main/java/com/yihu/hos/HosAdminApplication.java

@ -7,7 +7,8 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
@ -17,7 +18,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.data.web.config.EnableSpringDataWebSupport;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@EnableAsync
@ -30,7 +30,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@SpringBootApplication(scanBasePackages={"com.yihu.ehr","com.yihu.hos"})
@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class,
        SecurityAutoConfiguration.class})
public class HosAdminApplication extends WebMvcConfigurerAdapter {
public class HosAdminApplication extends SpringBootServletInitializer {
    public static void main(String[] args) throws Exception {
        SpringApplication application = new SpringApplication(HosAdminApplication.class);
@ -38,9 +38,13 @@ public class HosAdminApplication extends WebMvcConfigurerAdapter {
//        SpringBeanUtil.setContext(run);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(HosAdminApplication.class);
    }
    // 增加拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(webMvcInterceptor());
    }