Here you can see I am starting server foo, stopping it, and starting another server bar. Although server foo was stopped, error handler is still returning foo.
I suggest to add something like ExceptionMapper.getServletInstance().clear() to SparkFilter.destory()
Spark servlet exception mapper is not cleaned after server stopped. I've created a test to illustrate issue we are facing: https://github.com/perwendel/spark/compare/master...sukolenvo:test-servlet-clean
Here you can see I am starting server
foo
, stopping it, and starting another serverbar
. Although serverfoo
was stopped, error handler is still returningfoo
.I suggest to add something like
ExceptionMapper.getServletInstance().clear()
toSparkFilter.destory()
Can open PR for test and/or fix if needed.