spring-projects / spring-projects/spring-security

getOutputStream() has already been called for this response

Open
#4,239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

When I use Logbook auto configuration with Spring Security with Spring Boot app packaged as war and deployed to Tomcat and try to access non existent url, I get

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Mar 07 18:14:22 CET 2017
There was an unexpected error (type=Internal Server Error, status=500).
getOutputStream() has already been called for this response

I have prepared minimal example to reproduce it here

without Logbook it works as expected - basic auth is required
without Spring Security it works as expected - not found error message is shown
when packaged as jar with embedded Tomcat it works perfectly

The problem is not present only when accessing non existent url - if there would be any controllers in my example, you would not be able to access them neither.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked minimal example and reproduce the failure when the Spring Boot app is packaged as a WAR and deployed to Tomcat. Compare the Logbook auto-configuration, Spring Security, and embedded-Tomcat cases described in the issue. Done means nonexistent URLs show the expected error response and protected controllers still require basic authentication without the getOutputStream() error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.