To the people who encounters "org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException..."

If you are using the latest Apple silicon, you may have to change your maven pom.xml to use the latest spring 5.2.0.RELEASE, because you are hitting by Spring issue #21674 which was fixed in Spring 5.1 . So you update your maven file as following, then you are good.

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>5.2.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>5.2.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>5.2.0.RELEASE</version>
        </dependency>
2 Likes

Hi :wave: @Junlei_Li,

Thank you for sharing it with the community!

Regards,
Kushagra

1 Like