Maven 项目无法在 Wildfly 服务器上部署

时间:2021-04-18 16:55:50

标签: eclipse hibernate maven jboss wildfly

我的项目一直无法部署,我尝试过 maven 更新干净并安装,以及从 Wildfly 服务器中删除项目并重新部署。 错误信息是

17:41:05,365 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) JBAS014613: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
    "jboss.deployment.subunit.\"PROJECTNAME-ear-0.0.1-SNAPSHOT.ear\".\"PROJECTNAME-resource-war-0.0.1-SNAPSHOT.war\".weld.weldClassIntrospector is missing [jboss.deployment.subunit.\"PROJECTNAME-ear-0.0.1-SNAPSHOT.ear\".\"PROJECTNAME-resource-war-0.0.1-SNAPSHOT.war\".beanmanager]",
    "jboss.persistenceunit.\"PROJECTNAME-ear-0.0.1-SNAPSHOT.ear/PROJECTNAME-model-0.0.1-SNAPSHOT.jar#DBNAME\".__FIRST_PHASE__ is missing [jboss.naming.context.java.\"\\\"java:jboss\".datasources.\"DBNAME\\\"\"]",
    "jboss.deployment.unit.\"PROJECTNAME-ear-0.0.1-SNAPSHOT.ear\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"PROJECTNAME-ear-0.0.1-SNAPSHOT.ear\".beanmanager]"
    ]

独立文件.xml

<datasource jndi-name="java:jboss/datasources/DBNAME" pool-name="DBNAME" enabled="true" use-java-context="true">
        <connection-url>jdbc:mysql://localhost:3306/DBNAME</connection-url>
        <driver>mysqlDriver</driver>
        <security>
                <user-name>root</user-name>
                <password></password>
        </security>
</datasource>

持久性.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
    xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    
    <persistence-unit name="DBNAME" transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>"java:jboss/datasources/DBNAME"</jta-data-source>
        <properties>
            <property name="hibernate.show_sql" value="false" />
            <property name="hibernate.jdbc.batch_size" value="25"/>
            <property name="hibernate.connection.autocommit" value="true" />
            <property name="org.hibernate.dialect.H2Dialect" value="true"/>
        </properties>
    </persistence-unit>
</persistence>

beans.xml

<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd" bean-discovery-mode="all" version="2.0">
</beans>

我之前将该项目部署为动态 Web 项目,但自从切换到 maven 多模块项目后,我一直遇到这个问题

0 个答案:

没有答案