Code does not compile out of the box

java.lang.IllegalStateException: Cannot load configuration class: mflix.Application

Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @25ac91bd

Are other facing same issue ?

Hi @Himanshu_Tech,

Welcome to the MongoDB University forums :sparkles:

This might be happening because you are hitting by Spring issue #21674 which was fixed in Spring 5.1. Try changing to latest spring 5.2.0.RELEASE

To do so just modify the JUnit part as follows in the pom.xml and re-run it.

         <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>

I hope it will resolve the issue.

In case you have any doubts, please feel free to reach out to us.

Thanks,
Kushagra Kesav