The problem is that cglib is hard to migrate. This is because:
- newer cglib versions are not compatible to their earlier versions
- newer ASM versions are not compatible to their earlier versions (cglib is built on top of asm)
The FAQ to ASM therefore recommends:
15 How to resolve conflicts between different ASM API versions available in a global classpath or within the same ClassLoader?
Tools and frameworks that are using ASM for bytecode processing (e.g. Hibernate, CGLIB, AspectWerkz) should repackage ASM code within their own name space. This can be automated with Jar Jar Links tool.
I recommend you to do the same with cglib. Move the entire dependency into a new package (create a independent name space) and only use this dependency. It is ugly, but it is the only solution. Other projects like Spring or Hibernate deal with cglib in the same manner.