Springboot Wildfly 10 部署错误 jdk.unsupported module not found

Kik*_*ich 4 java maven wildfly spring-boot wildfly-10

我有一个 Java 1.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
Run Code Online (Sandbox Code Playgroud)

我已经创建了一个 jboss-deployment-structure.xml 并在那里添加了“jdk.unsupported”依赖项,我还尝试将其添加到 MANIFEST.MF 中,并且我还尝试将缺失的“jdk.unsupported”依赖项添加到maven-war 插件下的 pom 文件,但没有运气。

Mar*_*dra 24

我找到了一个更好的解决方案,基于在 jboss 或 wildfly 上创建一个名为jdk.unsupported的新假模块。

就我而言,我无法升级 JBoss EAP 7.1,并且我想保持更新到最新版本的 Spring。

所以我所做的就是在modules/system/layers/base文件夹下创建一个新的假模块,它的工作就像一个魅力!

  • 您应该为 JBoss 创建一个新模块。这很容易做到。1. 在 *$JBOSS_PATH/modules/system/layers/base* 下创建一个名为 *jdk/unsupported/main* 的新文件夹 2. 在 *main* 文件夹下创建一个名为 *module.xml* 的新文件,内容如下: ´´´´ <?xml version="1.0"encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.5" name="jdk.unsupported"> </module> ´´´ ´ (13认同)

Pra*_*ran 11

这是由于重大更改,这是在Spring核心的推出5.3.*,在导致上述问题是Spring核心库的变化承诺。如果您使用 Spring 引导版本,2.4.*那么您肯定会遇到这个问题,因为它会拉取 Spring-core 的传递依赖5.3.*。务实的做法是,如果可能的话,升级wildfly 版本(最新版本是22.0.1.Finalwildfly 10.1.0.Final 发布于2016 年8 月19 日将近5 年前)或将您的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-core 5.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用户提供了代码片段
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'
}

Run Code Online (Sandbox Code Playgroud)


Avi*_*uja 1

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