Spring 5 + Tomcat standalone - 截断响应

时间:2018-04-03 10:32:26

标签: spring tomcat spring-boot

我有用Spring Boot 2和REST API编写的应用程序。当我通过bootRun gradle任务在嵌入式Tomcat服务器上运行此应用程序时,一切都很好。 问题是当此应用程序部署在独立的Tomcat 8.5服务器上时,响应被截断为8kB。那是为什么?

我的REST控制器:

@RestController
public class ApiController {
    public ResponseEntity<Mono<ResultData>> get(String param) {
        // generating data
        return ResponseEntity.ok(Mono.just(ResultData.builder()
            .data(data)
        .build()));
    }
}

1 个答案:

答案 0 :(得分:1)

解决。我还没有扩展SpringBootServletInitializer(https://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html) - 当您想要将Spring Boot应用程序作为可部署的战争运行时,您必须这样做。