Menu
  • HOME
  • TAGS

cglib throws an IllegalArgumentException when enhancing the java.util.Date class

java,cglib

It seems like your are using a JDK in version 8 which includes class files in version 8. These class files are not supported by cglib as this library depends on an outdated version of ASM. To debug this, we have to note that ASM does not include any debugging...

cglib vs javaassit vs java refelection

reflection,cglib,javaassist

I have found the benefits of cglib over Java reflection. Class generated using runtime byte-code generation library (cglib, javassit, byte buddy) can be altered at runtime without recompiling and Java Reflection classes can't be altered.

Spring aop, cglib enhanced class lose generic info

java,json,spring,struts2,cglib

My idea is try to find the actual type behind the proxy. According to spring documentation, any proxy obtained from spring aop implements the org.springframework.aop.framework.Advised interface, and this interface expose method to query the target class. Any AOP proxy obtained from Spring can be cast to this interface to allow...

JavaClassLoader: Why an “NoSuchMethodEx” is thrown here?

java,reflection,nosuchmethoderror,cglib

jcl: manipulating-class-loading-order @ChristianFrommeyer gave me the solution. I want to explain it, so it's own answer. The launcher is still loaded by the "normal" class loader. All objects that are loaded in this class will be loaded by the same class loader as the Launcher. I load now from the...

Calling a @Bean annotated method in Spring java configuration

java,spring,cglib

Yes, Spring does some magic. Check the Spring Docs: All @Configuration classes are subclassed at startup-time with CGLIB. In the subclass, the child method checks the container first for any cached (scoped) beans before it calls the parent method and creates a new instance. This means that your the calls...

Create Mixin without using interfaces

java,mixins,cglib

No need for anything fancy, just a bit of dull donkey work. Create the interfaces you'd like to program against, then create concrete classes that implement them using the legacy library. You can now create mixins using cglib if you really want to, but more importantly you can develop your...

Spring CGLib and EasyMock - attempted duplicate class definition

spring,proxy,easymock,cglib

This error occurs because both are independently using the DefaultNamingPolicy which computes the class's name from the hash codes of the provided interceptors. This naming policy claims that it detects duplicate names but this does not seem to work. You should therefore set a different naming policy, either within Spring...

NamedParameterJdbcTemplate and CGlib in Spring AOP

java,spring,spring-mvc,spring-aop,cglib

I had the exact same error message. I was using Spring 3.2.5.RELEASE version. After debugging and trying to repeat the problem with PetClinic example came out it was matter of Spring version. This problem didn't occur in Spring 4.1.1. Try to upgrade, maybe it works.

After upgrade, tests pass in Eclipse, fail in Maven, Spring throws BeanCreationException / NoClassDefFoundError $proxy10

java,spring,maven,cglib,spring-ioc

I stripped out most dependencies and removed large amounts of code until it worked and then started adding the latest version of dependencies back in as I uncommented the code and they became necessary for compilation and testing. I reached the end of this process without the error resurfacing. These...