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 just experienced this issue when a test on an existing class started failing with 'expected to be of type...but was actually of type 'com.sun.proxy.$Proxy115'.
What it turned out to be was that I had used Intellij's 'pull method up [to interface]' on an @Transactional method that I had added to the interface's implementation class, and Intellij decided to add @Transactional to the interface method declaration. If there is just one @Transactional method in an interface then it seems to screw things up, resulting in this error.
Somewhere in your code you must be autowiring AdminServiceImpl
like this:
@Autowired
private AdminServiceImpl adminService;
Either depend barely on interface:
@Autowired
private AdminService adminService;
or enabled CGLIB proxies.
I found lots of questions similar to this one, when searching google for my problem. However, in my case I already used an interface. So I thought this might be helpful for others:
This exception could also appear, if you have two beans with the same name!
In my case I had additional bean configuration in my applicationContext.xml. The problem appeared after I merged two applications. The second one defined a @Resource
and its member-variable name matched the bean name of the first application, mentioned above. Of course, the bean configuration of the first application didn't fit for the bean included via @Resource
by the second application.