Fixing BeanNotOfRequiredTypeException on Spring proxy cast on a non-singleton bean?

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> 

Leave a Comment