Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal reflective access warning for CGLIB proxy on JDK 11 #23288

Closed
bmoshe opened this issue Jul 14, 2019 · 4 comments
Closed

Illegal reflective access warning for CGLIB proxy on JDK 11 #23288

bmoshe opened this issue Jul 14, 2019 · 4 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: superseded An issue that has been superseded by another type: regression A bug that is also a regression

Comments

@bmoshe
Copy link

bmoshe commented Jul 14, 2019

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!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 14, 2019
@jhoeller jhoeller self-assigned this Jul 15, 2019
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 17, 2019
@jhoeller jhoeller added this to the 5.1.9 milestone Jul 17, 2019
@jhoeller jhoeller changed the title Illegal reflective access Illegal reflective access for CGLIB proxy on JDK 11 Jul 17, 2019
@jhoeller jhoeller changed the title Illegal reflective access for CGLIB proxy on JDK 11 Illegal reflective access warning for CGLIB proxy on JDK 11 Jul 17, 2019
@jhoeller
Copy link
Contributor

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.

@ggutierrezgarzon
Copy link

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

@ggutierrezgarzon
Copy link


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

@jhoeller
Copy link
Contributor

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.

@jhoeller jhoeller removed this from the 5.x Backlog milestone Jan 23, 2021
@jhoeller jhoeller added the status: superseded An issue that has been superseded by another label Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: superseded An issue that has been superseded by another type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

4 participants