Affects: 2.1.6.RELEASE

Hey guys,

I'm using JDK 11.0.2 and Spring Boot 2.1.6.RELEASE. Right after the upgrade to 2.1.6.RELEASE, I started getting the following warning:

WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils (file:/.../org/springframework/spring-core/5.1.8.RELEASE/spring-core-5.1.8.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
    at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:525)
    at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:363)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108)
    at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
    at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
    at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
    at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134)
    at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319)
    at org.springframework.cglib.reflect.FastClass$Generator.create(FastClass.java:65)
    at org.springframework.cglib.proxy.MethodProxy.helper(MethodProxy.java:135)
    at org.springframework.cglib.proxy.MethodProxy.init(MethodProxy.java:76)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:216)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684)
    at platterz.accounting.services.LedgerServiceImp$$EnhancerBySpringCGLIB$$dfc059db.toString(<generated>)
    at platterz.treat.jobs.RuleCreditingJob.execute(RuleCreditingJob.kt:31)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

Is it planned on being fixed anytime soon? Is there a workaround? Do you guys need additional logs?

Thanks, Moshe!

Comment From: jhoeller

For the time being, these warnings should go away when starting the JVM with --illegal-access=deny since we are going to fall back to the JDK 9+ defineClass API even without a ClassLoader match.

Comment From: ggutierrezgarzon

I used this pom and my problem disappeared

4.0.0 org.springframework.boot spring-boot-starter-parent 2.2.1.RELEASE com.universidad.springboot.backend.academia academia 0.0.1-SNAPSHOT academia Demo project for Spring Boot

1.8 Hoxton.RC2

org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter-web

org.springframework.boot spring-boot-devtools runtime mysql mysql-connector-java runtime org.springframework.boot spring-boot-starter-test test

javax.xml.bind jaxb-api

org.glassfish.jaxb jaxb-runtime

org.springframework.security spring-security-test 5.1.2.RELEASE test com.h2database h2 test 1.4.194

org.springframework.security spring-security-jwt 1.1.0.RELEASE

javax.xml.bind jaxb-api

org.glassfish.jaxb jaxb-runtime

com.walterjwhite.java.dependencies hikari-jdbc-connection-pool 0.0.17 pom

org.springframework.boot spring-boot-maven-plugin

Comment From: ggutierrezgarzon

4.0.0 org.springframework.boot spring-boot-starter-parent 2.2.1.RELEASE com.universidad.springboot.backend.academia academia 0.0.1-SNAPSHOT academia Demo project for Spring Boot

1.8 Hoxton.RC2

org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter-web

org.springframework.boot spring-boot-devtools runtime mysql mysql-connector-java runtime org.springframework.boot spring-boot-starter-test test

javax.xml.bind jaxb-api

org.glassfish.jaxb jaxb-runtime

org.springframework.security spring-security-test 5.1.2.RELEASE test com.h2database h2 test 1.4.194

org.springframework.security spring-security-jwt 1.1.0.RELEASE

javax.xml.bind jaxb-api

org.glassfish.jaxb jaxb-runtime

com.walterjwhite.java.dependencies hikari-jdbc-connection-pool 0.0.17 pom

org.springframework.boot spring-boot-maven-plugin

Comment From: jhoeller

Aside from several available refinements in recent releases, this is superseded by efforts around #22814 and #26403, to be picked up in corresponding Boot releases.