I\'m having an issue with pulling a Spring bean from an application context.
When I try;
InnerThread instance = (InnerThread) SpringContextFactory.g
There was this problem until I just restart Idea and rebuilt the Maven project.
Another way to handle this problem would be to implement an interface and request the interface from spring, the proxy would fully implement the interface, and the cast shouldn't have a problem.
Annotate your @Configuration
class with
@EnableAspectJAutoProxy(proxyTargetClass = true)
You also have to add the following dependency:
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.7.2</version>
</dependency>