I have a rather strange set of circumstances. I am using Spring 3.0.6 with a bean that implements an interface as well. Still pretty normal stuff. My bean also has some protected methods. I use some AOP (JDK Proxies) and everything works fine.
My problem arises when I want to insert this bean into another package class. Under normal circumstances, I could implement an implementation and access protected methods. Unfortunately, since this is a JDK proxy, I can only enter based on the interface.
Since I need access to protected methods, I cannot declare methods in the interface, so I'm a bit in a catch-22 situation. I tried switching to CGLIB proxies, but they crashed with other advisors advising beans with final methods, etc.), so this is not a solution.
Any suggestions on what I can do? I tried using the @PostConstruct method to extract a bean from the application context, but there (unsurprisingly) it can only get a Proxied bean and therefore cannot relate it to the required implementation.
Any suggestions would be appreciated.
Thanks!
Eric
source share