Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat exception Cannot call sendError() after the response has been committed?

This error is a symptom of some other problem, not the root cause you're looking for.

This error explains why the user can't be redirected to the error page. (Reason: the server has already flushed part of the response buffer back to the client - it's too late to switch/redirect to the error page.)

As the error message points out, check elsewhere in your Apache Tomcat 7 logs (or debug your app another way) to find what is throwing an exception.


I was creating a @ManyToOne and @OneToMany relationship. I added @JsonIgnore above the @ManyToOne and it solved the error.


I solved this error by adding @jsonIgnore to all getters for a List of another object


For others in my situation--What was happening was that I had two @Entity objects with a many to many relationship causing infinite json to be generated, causing spring security to throw this error. Try adding @JsonIgnore above your hibernate relationships.