java - Wildfly 17.0.1.Final 上的部署问题

标签 java eclipse logging jboss wildfly

我想在 Wildfly 17.0.1.final 上部署一个由子模块组成的 Ear 文件。 该代码正确部署在 wildfly 10.1.0.final 上,但在 wildfly 17.0.1.final 上出现问题。 我尝试了standalone.xml 和standalone-full.xml。 使用standalone.xml进行部署时,我在部署控制台上收到以下错误:-

Service service jboss.ejb.default-resource-adapter-name-service not found

当我在部署控制台上使用standalone-full.xml时,出现以下错误:-

{"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"WFLYCTL0080: Failed services" => {"jboss.depl oyment.subunit.\"MyEarFile.ear\".\"EAR-AllVersion1.0.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment \"EAR-AllVersion1.0.war \" of deployment \"MyEarFile.ear\" Caused by: java.lang.NoSuchMethodError: org.hibernate.validator.internal.util.logging.LoggerFactory.make()Lorg/hibernate/validator/internal/util/logging/Log;","jbo ss.deployment.subunit.\"MyEarFile.ear\".\"EARmobile-AllVersion1.0.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment \"EARm obile-AllVersion1.0.war\" of deployment \"MyEarFile.ear\" Caused by: java.lang.NoSuchMethodError: org.hibernate.validator.internal.util.logging.LoggerFactory.make()Lorg/hibernate/validator/internal/util/logging/Log;"},"WF LYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.comp.MyEarFile.\"EjbDbfinder-AllVersion1.0\".ChangeBasicDataBaseData","jboss.namin g.context.java.comp.MyEarFile.\"EjbDbfinder-AllVersion1.0\".MessegeConsumer",........ .. .. .. ..]"]}}}

我不知道如何解决它。我尝试从 pom 中删除 sl4j 依赖项,但仍然不起作用。我为此使用 eclipse ide,并且刚刚为 wildfly 安装了 jboss 工具,因为其他 jboss 工具没有安装。 因此,请让我知道我需要如何升级它来部署代码并使其运行。如果我需要为此指定更多详细信息,请告诉我。

以下是我正在使用的 Hibernate 依赖项:-

在数据库模块中:-

<dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.1-api</artifactId>
        <version>1.0.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.0.1.Final</version>

    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId> hibernate-core</artifactId>
        <version>4.0.1.Final</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-ehcache</artifactId>
        <version>4.0.1.Final</version>
    </dependency>
<!--In other Module:--->
<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.5.1-Final</version>
            <scope>compile</scope>
        </dependency>

任何帮助将不胜感激。

最佳答案

我找到了解决方案。这就是我实现目标的方法:-

    <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-ehcache</artifactId>
            <version>5.4.2.Final</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.logging</groupId>
                    <artifactId>jboss-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>6.0.16.Final</version>
        </dependency>

            <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>3.4.0.Final</version>
        </dependency>
<dependency>
            <groupId>org.wildfly</groupId>
            <artifactId>wildfly-weld</artifactId>
            <version>17.0.1.Final</version>
        </dependency>

从 hibernate-ehcache 中排除 jboss-logging、更改 wildfly 依赖项并包含 hibernate-validation 依赖项解决了我的问题。

关于java - Wildfly 17.0.1.Final 上的部署问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57036223/

相关文章:

ios - 电池电量不足会导致应用程序在iPad上崩溃吗?

java - GCC 原生 Java 编译器作为典型开源 Java 项目的平台有多实用?

java - Android 服务 - 重新绑定(bind)时 Intent 不会更新

c - 使用远程 GDB 在 Eclipse 中调试

java - 将 groovy 添加到目标平台

user-interface - 如何设计好的 "progress panel"

java - Play 2.4.6 框架中的表单未绑定(bind)

java - 将 org.joda.time.DateTime 转换为 java.time.OffsetDateTime 的最佳方法是什么?

eclipse - 向 webService 客户端提供 keystore

JAVA SimpleFormatter,无法设置正则表达式