首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Springboot Wildfly 10部署错误找不到jdk.unsupported模块

Springboot Wildfly 10部署错误找不到jdk.unsupported模块
EN

Stack Overflow用户
提问于 2020-12-02 09:26:16
回答 2查看 7K关注 0票数 7

我有一个使用Java1.8的Springboot v2项目,当我尝试在Wildfly 10上部署我的springboot项目时,我总是收到这个错误

代码语言:javascript
运行
复制
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”依赖项,但没有成功。

EN

回答 2

Stack Overflow用户

发布于 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并将其拉入类路径,需要执行以下步骤:

  1. 由于jar文件本身,归档使用以下命令打开它7-Zip/winrar或者使用任何文件归档实用工具。打开MANIFEST.MF并删除最后一行Dependencies: jdk.unsupported并保存更改。
  2. 将打了补丁的jar文件放入您的项目文件夹中,即,lib
  3. 排除Spring-core 5.3.x在项目级别,并强制执行构建工具以使用Spring-core 5.3.x并将其添加到您的类路径中。我已经为您提供了以下内容的代码片段:gradle用户
代码语言:javascript
运行
复制
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'
}
票数 15
EN

Stack Overflow用户

发布于 2021-01-21 17:25:18

我遇到了完全相同的问题,并通过使用java 8将wildfly 10升级到20来解决它。我的spring boot版本是2.4.0,或者,我将spring boot版本降级到1.5.8版本,并能够在wildfly 10上成功运行。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65100927

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档