-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Illegal reflective access operation on Java 11 for lazy-init beans registered with MBeanServer #22814
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
Comments
@porfirioribeiro, can you please launch your JVM with |
@sbrannen I am getting the same warning messages. I use spring-boot 2.0.7.RELEASE with java
I launched JVM with --illegal-access=debug and got the following stack trace
Logs were printed when code The version of the Spring Framework core |
@isabek, according to the comments from @jhoeller in #22674 (comment), "those warnings will only disappear as of Spring Framework 5.1+". So, if you are seeing them with Can you confirm that you do not see them on Spring Framework 5.1+? |
Sorry for the late reply:
|
@porfirioribeiro, thanks for providing the stack trace. I have updated this issue's title accordingly. |
@jhoeller, I've tentatively assigned this to you since you handled similar issues in the past. |
I think I am getting the same warning with spring boot 2.1.5 and Java 11. This is the stack trace I am getting, looks like Spring Framework 5.1.7. The warning started to occur after I added
build.gradle looks like this: plugins {
id 'org.springframework.boot' version '2.1.5.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
ext {
set('springCloudVersion', "Greenwich.SR1")
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
} |
Very similar issue on my end, started showing up after upgrading to Boot 2.1.5 and Java 11.
|
Hi, I have been monitoring this issue for a few months as I am experiencing the exact same issue. When I use Spring Boot 2.1.3.RELEASE with Java 11, then I do not get this WARNING. When I move to Spring Boot 2.1.4.RELEASE, 2.1.5.RELEASE, 2.1.6.RELEASE and 2.1.7.RELEASE I get the warning. I am not sure why we did not get this warning on 2.1.3.RELEASE. Maybe it was fixed and there has been a code regression. Or maybe the issue is present on 2.1.3.RELEASE but the WARNING is just not being logged. |
I can confirm this exists with These are the BOM's and Deps causing this:
|
Also getting this on Boot 2.2.0.M6 with JDK 12. Seems to be a slightly different stack trace than the ones posted above:
|
Same issue on Spring Boot 2.2.0.RC1 + Spring Framework 5.2.0 with JDK 11.
|
Similar Issue on Spring Boot 2.2.0.RELEASE, Spring Cloud Gateway 2.2.0.M3 (Spring Cloud Version: Hoxton.M3)
|
|
java version
spring version
After add '--illegal-access=debug'
|
I have the same problem, so here is my small contribution... I use JDK 11 / Spring Boot 2.2.1 The message appears only if I add Dev Tools dependency. Without Dev Tools, no message. |
Updating to the latest spring boot 2.2.4 (with spring 5.2.3) did not change much:
|
I have same problem using Java 11(AWS Corretto 11) and SpringBoot 2.2.4 on Ubuntu 18.04
|
Same problem with Java 11, SpringBoot 2.2.6.RELEASE
Problem append only when I add Filter component
|
#Solved |
Just to possibly help out with info for this issue: I was in the process of creating a basic app and when I added the I'm using Spring Boot 2.3.0.RELEASE with JDK 11.0.2 In the meantime, I followed this #23099 (comment) and now it doesn't show up in the console. |
Maybe |
What is the final solution for this as am also facing the same issue, anyone ? |
Same issue here. Any news about it? |
Depends on your Java env
Then make sure you have
|
similar problem here when running: Spring Boot: 2.3.4.RELEASE
I'm trying to enable the Spring Boot LogFile Actuator, and so I have added this to my application config:
application starts up fine with above config, until I add
and then the application breaks (log4j2 stops working entirely) due to the JVM warnings:
when you add
this is the output:
|
Please provide your java version. |
see my environment output at the beginning of my comment ( |
Use 1.8 (Java 8)
I have resolved it by downgrading java version to 1.8 |
@iamprashant sorry, but that is not a solution, I need Java 11 features and Java 11 is an LTS version, it should be supported |
@alan-czajkowski specify java version in your pom.xml, maven-compiler-plugin with source & target or release. define this in your pom.xml
|
I am hitting this too on a very simple project, at startup, with a simple gradle using the latest stable spring dependencies. |
@LifeIsStrange here's the reference to the issue you've created in Spring Boot: spring-projects/spring-boot#24857 |
@iamprashant what have you provided that is a solution to this specific issue? specifying the JDK version in the compiler plugin is not a solution |
I'm surprised that no ticket existed before 3 days ago. The original problem dates back almost 2 years ago and its pretty much existed since then. |
An update. Spring Framework 5.3.4 has a fix for the If you're not using devtools, an update with a recent Spring Boot version would be most welcome. |
As mentioned by Stephane, we're addressing a common cause - Spring Boot's RestartClassLoader as used in Boot DevTools - through #26403 and a corresponding revision in Boot itself, to be released in our February maintenance releases. This will make the warnings go away for DevTools setups in which pre-loaded classes from a lower ClassLoader are getting proxied. Unfortunately the JDK's warning is not specific enough. The actual cause is specific to the application's setup and not really related to the core framework and its CGLIB fork. The debug stacktraces aren't very telling either, we'd rather need to know why the target ClassLoader for the proxy class is different from the ClassLoader that the original class is defined in. If those ClassLoaders differ, we have to fall back to All past reporters here, thank you for your efforts so far. All further encounters, please do not post similar-looking stacktraces here anymore. We'd rather need debugging of the ClassLoader arrangement as discussed above, and a specific report to the project that causes the ClassLoader mismatch (that will typically be Spring Boot or Spring Cloud, not Spring Framework itself). At this point I'd also ask everyone to wait for the February releases and only report remaining warnings beyond that point. Alternatively, you may also deactivate DevTools and see whether the warnings disappear right away. A known tough case is proxying for JDK library classes (such as HashMap or MBeanServer). This is currently always going to trigger a warning since we are not allowed to define a proxy class in the Last but not least, please take such warnings with a grain of salt. A warning does not mean that startup will fail when illegal access is being denied. If our |
I face Same Issue In My Case This Will Happen Due To old Jason Import File |
I'm using spring-boot 2.2.0.M2 with Java 11 and i am getting this warning:
I don't know if it is a know bug with spring-boot+java11 or an issue on my end
The text was updated successfully, but these errors were encountered: