spring 为什么不需要CGLIB包

关于cglib的jar包官方的文档上有这么一段话

note

for this dynamic subclassing to work, the class that the spring container will subclass cannot be final, and the method to be overridden cannot be final either. also, testing a class that has an abstract method requires you to subclass the class yourself and to supply a stub implementation of the abstract method. finally, objects that have been the target of method injection cannot be serialized. as of spring 3.2 it is no longer necessary to add cglib to your classpath, because cglib classes are repackaged under org.springframework and distributed within the spring-core jar. this is done both for convenience as well as to avoid potential conflicts with other projects that use differing versions of cglib

意思是说,从spring3.2以后,spring框架本身不在需要cglib这个jar包了,因为cjlib.jar已经被spring项目的jar包集成进去。

为了防止项目中其他对cglib版本依赖不一样的冲突。

博客地址:http://www.makaidong.com/shizhongtao/


搜索此文相关文章:spring3.2以后的cglib的jar包问题此文链接:http://www.makaidong.com/%E5%8D%9A%E5%AE%A2%E5%9B%AD%E7%9F%A5%E9%81%93/31326.shtml转载请注明出处:spring3.2以后的cglib的jar包问题 - 博客园

猜你喜欢

转载自blog.csdn.net/qq_34627002/article/details/84567993