我有一个使用Java1.8的Springboot v2项目,当我尝试在Wildfly 10上部署我的springboot项目时,我总是收到这个错误
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
我已经创建了一个jboss-deployment-structure.xml并在其中添加了"jdk.unsupported“依赖项,我还尝试将其添加到MANIFEST.MF中,还尝试在maven-war插件下的pom文件中添加缺失的"jdk.unsupported”依赖项,但没有成功。
发布于 2021-02-13 01:27:26
这是由于突破性的变化,它是在Spring-core中引入的5.3.*,导致上述问题的Spring-core库中的更改是
提交..。如果您使用Spring boot版本2.4.*那么您肯定会面临这个问题,因为它拉动了Spring-core的传递依赖5.3.*..。实用的方法是在可能的情况下升级wildfly版本(最新版本是22.0.1.Final、wildfly 10.1.0.Final、大约5年前于2016年8月19日发布)或将您的Spring boot版本降级为'2.3.*.RELEASE'..。
解决方法
对于那些无法升级Wildfly服务器但需要使用最新Spring版本的用户,请遵循以下解决方案(5.3.*)。实际问题是Spring-core 5.3.x包含MANIFEST.MF文件条目Dependencies: jdk.unsupported..。如果我们从jar的MANIFEST.MF文件中删除特定的条目,我们就可以在Wildfly 10.X版本中使用Spring-core5.3.x。
要修补5.3.x并将其拉入类路径,需要执行以下步骤:
dependencies {
//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'
}
发布于 2021-01-21 17:25:18
我遇到了完全相同的问题,并通过使用java 8将wildfly 10升级到20来解决它。我的spring boot版本是2.4.0,或者,我将spring boot版本降级到1.5.8版本,并能够在wildfly 10上成功运行。
https://stackoverflow.com/questions/65100927
复制相似问题