Java Springboot Wildfly 10部署错误jdk。未找到不支持的模块
我有一个使用Java1.8的SpringBootV2项目,当我尝试在Wildfly 10上部署Springboot项目时,我不断遇到这个错误Java Springboot Wildfly 10部署错误jdk。未找到不支持的模块,java,spring-boot,maven,wildfly,wildfly-10,Java,Spring Boot,Maven,Wildfly,Wildfly 10,我有一个使用Java1.8的SpringBootV2项目,当我尝试在Wildfly 10上部署Springboot项目时,我不断遇到这个错误 19:12:25,295 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment"
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中,并尝试添加缺少的“jdk.unsupported”依赖maven war插件下的pom文件,但运气不佳。我遇到了完全相同的问题,并通过使用java 8将wildfly 10升级到20解决了这个问题。 我的spring boot版本是2.4.0 或者,我将我的spring引导版本降级为1.5.8.RELEASE,并能够在wildfly 10上成功运行。这是由于spring core
5.3.*
中引入了spring core库中导致上述问题的更改。如果您使用的是Spring引导版本2.4.*
,那么您肯定会遇到这个问题,因为它会导致Spring核心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.*
)的用户,请遵循以下解决方法。实际问题是SpringCore5.3.x包含MANIFEST.MF
文件条目依赖项:jdk.unsupported
。如果我们从jar的MANIFEST.MF文件中删除特定条目,我们可以在Wildfly 10.x版本中使用SpringCore 5.3.x
要修补5.3.x并将其拉入类路径,需要执行以下步骤:
7-Zip
/winrar
或任何文件归档实用工具打开它。打开MANIFEST.MF
并删除最后一行依赖项:jdk.unsupported
并保存更改lib
Spring core 5.3.x
,强制使用构建工具从项目目录中使用Spring core 5.3.x
的修补库,并将其添加到类路径中。我已经为gradle
用户提供了代码片段WildFly 10中没有模块
jdk。不支持的。你创建了这个模块吗?没有。我相信它是在Java9上引入的。我使用的是Java8,所以我不确定代码的哪一部分在寻找它。这个异常来自JBoss模块,所以它试图加载该模块。你确定你用的是WildFly 10吗?如果您有一个jboss deployment structure.xml
或MANIFEST.MF
模块条目不正确。您的回答帮助我解决了这个问题。成功了+1@XsoluteIm,我添加了我在项目中使用的变通方法,除非我在项目中使用maven,否则您的变通方法非常有用,谢谢!
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'
}