Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

488
Visualizações
Error response body is empty in Spring Boot 2.6

There is an application on Spring Web stack. I faced an unusal problem after the upgrading to the lastest Spring Boot 2.6.1.

The following code

@RestController
@RequestMapping("sample")
class SampleController {
    @PostMapping
    fun doSomething(@RequestBody body: Any): Any {
        error("Error!")
    }
}

used to produce the following error in earlier versions

{
    "timestamp": "2020-05-27T13:44:58.032+00:00",
    "status": 500,
    "error": "Internal Server Error",
    "message": "Error!",
    "path": "/sample"
}

But after the upgrade the whole response body is empty. Not the message field which is could be fixed with server.error.inclide-message: always flag setting, but the whole body. The include-binding-errors: always flag has no effect as well.

I found no notes about that behavior in the Spring Boot changelog

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Have a look at this issue: https://github.com/spring-projects/spring-boot/issues/28953

If you permit access to the /error whitelabel page in your SecurityConfig it should work again. However, this seems to be a workaround as the issue is still in progress.

over 4 years ago · Santiago Trujillo Relatório

0

So it was a bug in 2.6.0 and 2.6.1 version. Fixed in 2.6.2

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda