【发布时间】:2014-12-26 04:37:17
【问题描述】:
我有一个使用 Spring Boot 开发的批处理应用程序。我的批处理应用程序需要来自 spring-boot-starter-web 的依赖项。具体来说,我需要一个支持spring-hateoas 和jackson-databind 的REST 客户端。如何禁用嵌入式 Tomcat 启动?我需要使用哪些排除项?
@EnableAutoConfiguration(excludes = {
/** What do I need to put here? */
})
@EnableBatchProcessing
@EnableConfigurationProperties
@ComponentScan
public class MyBatchApplication {
public static void main(String... args) {
SpringApplication.run(MyBatchApplication.class, args);
}
}
至少,这些还不够,因为它以异常结束:
@EnableAutoConfiguration(exclude = {
EmbeddedServletContainerAutoConfiguration.class,
WebMvcAutoConfiguration.class,
EmbeddedTomcat.class,
DispatcherServletAutoConfiguration.class
})
例外是:
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
【问题讨论】:
标签: rest spring-batch spring-boot