Springboot WildFly 10部署错误jdk。找不到不支持的模块

编程入门 行业动态 更新时间:2024-10-25 02:25:53
本文介绍了Springboot WildFly 10部署错误jdk。找不到不支持的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个带有Java 1.8的Springboot v2项目,当我尝试在WildFly 10上部署我的Sprringboot项目时,不断收到此错误

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

我已经创建了一个joss-ployment-structure.xml并在其中添加了";jdk.unsupport";依赖项,我还尝试将该依赖项添加到MANIFEST.MF中,还尝试在maven-war插件下添加缺少的";jdk.unsupport";依赖项,但没有成功。

推荐答案

这是由于Spring-core5.3.*中引入的breaking change,导致上述问题的Spring-core库的变化是commit。如果您使用Spring boot版本2.4.*,那么您肯定会面临这个问题,因为它拉出了Spring-core5.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文件中删除特定条目,我们就可以使用Wildfly10.x版本本身中的Spring-core 5.3.x。

要修补5.3.x并将其拉入类路径,需要执行以下步骤:

  • 作为JAR文件本身,归档使用7-Zip/winrar或任何文件归档实用工具打开它。打开MANIFEST.MF,删除最后一行Dependencies: jdk.unsupported并保存更改。
  • 将修补后的JAR文件放入您的项目文件夹,即lib
  • 在项目级别排除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' }

    更多推荐

    Springboot WildFly 10部署错误jdk。找不到不支持的模块

    本文发布于:2023-11-14 00:54:59,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1585778.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:找不到   不支持   模块   错误   WildFly

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!