繁体   English   中英

springboot Wildfly 10部署报错jdk.unsupported module not found

[英]Springboot Wildfly 10 deployment error jdk.unsupported module not found

我有一个带有 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

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

这是由于 Spring-core 5.3.*中引入的破坏性 更改,导致上述问题的 Spring-core 库中的更改是commit 如果您使用 Spring 引导版本2.4.*那么您肯定会遇到这个问题,因为它会拉取 Spring-core 5.3.*的传递依赖。 务实的方法是尽可能升级 wildfly 版本(最新版本为22.0.1.Finalwildfly 10.1.0.Final于 2016 年 8 月 19 日发布近 5 年)或将 Spring 引导版本降级为'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'
}

I faced exactly same issue and resolved it by upgrading wildfly 10 to 20 with java 8. My spring boot version was 2.4.0 Alternatively, i degraded my spring boot version to 1.5.8.RELEASE and was able to successfully run on wildfly 10.

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

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

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

我们正在使用 wildfly 11。我们可以使用的 spring 引导的最大版本是 2.3.11,没有这个问题。 从2.3.12开始,出现这个错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM