I\'m still new to Spring MVC and while building my test project, I got this message from Tomcat logs:
SEVERE: Exception sending context initialized event to
I also had this problem with some @SpringBootTest classes that were testing endpoints. The endpoints had a dependency on a DB Service that has @Transactional on a few methods.
Because of the @Transactional, Spring intercepts that and creates a proxy class, so Spock (or junit) would struggle to inject the correct mock.
My workaround was to push the DB Service down one layer and have plain Spock tests around the middle layer which aren't affected by this.