Notes for Spring AOP configuration: cglib
When an AOP proxy class is generated, the following error occurs: cocould not generate cglib subclass of class [class XXXX]: common causes of this problem include using a final class or a non-visible class;
After checking, it was originally written in the configuration for starting AOP in spring.
1 <AOP: aspectj-autoproxy proxy-target-class = "true"/>
2 <TX: annotation-driven proxy-target-class = "true" transaction-Manager = "txmanager"/>
In this case, spring uses cglib for proxy, but this method is not applicable to interface-oriented programming. That is to say, the class to be proxy cannot implement interfaces, in addition, a default constructor is required for normal use.
To solve this problem, use the default proxy method of spring and change the configuration
1 <AOP: aspectj-autoproxy/>
2 <TX: annotation-driven transaction-Manager = "txmanager"/>
OK.
Cocould not generate cglib subclass of class [Class X