I need to look for beans through their class type. When beans were wrapped by proxies (some methods are @Transactional) - ApplicatoinContext does not find them. I find that if I look through them through an interface, it works, but in this case I work with a specific class type. I know that a bean is of the type I'm looking for, but the getBean () method fails.
I can debug (and fix) the problem in Spring AbstractBeanFactory code. The problem is that it checks the beanInstance type for type I, but beanInstance.getClass () is a proxy server. AbstractBeanFactory should compensate for this and compare the type with the target proxy class.
I have a fix for this, but I really don't want to use a fixed version of Spring, and I suspect there must be something that I can tweak to get this to work, or is it really a bug?
source share