I have a Springboot v2 project with Java 1.8 and when I try to deploy my springboot project on Wildfly 10, I keep getting this error
19:12:25,295 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "HealthCheck.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.HealthCheck.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.HealthCheck.war\".main: WFLYSRV0179: Failed to load module: deployment.HealthCheck.war:main
Caused by: org.jboss.modules.ModuleNotFoundException: jdk.unsupported:main"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.module.service.\"deployment.HealthCheck.war\".main"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
I have already created a jboss-deployment-structure.xml and added the "jdk.unsupported" dependency there, I have also tried adding that to the MANIFEST.MF and I have also tried adding the missing "jdk.unsupported" dependency on the pom file under the maven-war plugin but no luck.
This is due to breaking change, which is introduced in Spring-core 5.3.*
, the change in the Spring-core library that causes the above issue is commit. If you use Spring boot version 2.4.*
then surely you will face this issue as it pulls the transitive dependency of Spring-core 5.3.*
. The pragmatic approach is either to upgrade the wildfly version if possible(The latest version is 22.0.1.Final
, the wildfly 10.1.0.Final
was released nearly 5 years back on Aug 19, 2016) or downgrade your Spring boot version to '2.3.*.RELEASE'
.
Workaround
Please follow the below workaround for those who cannot upgrade the Wildfly server but in the situation to use the latest Spring version(5.3.*
). The actual issue is the Spring-core 5.3.x contains the MANIFEST.MF
file entry Dependencies: jdk.unsupported
. If we remove the particular entry from the jar's MANIFEST.MF file we can use the Spring-core 5.3.x in the Wildfly 10.X version itself.
To patch the 5.3.x and pull it into the classpath, the following steps are required:
7-Zip
/winrar
or with any file archive utility tools. Open the MANIFEST.MF
and remove the last line Dependencies: jdk.unsupported
and save the change.lib
Spring-core 5.3.x
at the project level and enforce the build tool to use the patched library of Spring-core 5.3.x
from the project directory and add it to your classpath. I have provided the snippet for gradle
usersdependencies {
//Adding the patched jar into the classpath from a project directory
compile files('lib/spring-core-5.3.3.jar')
}
configurations.all {
//Excluding the spring-core-5.3.3.jar at the project level
exclude group: 'org.springframework', module: 'spring-core'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With