3
respostas

Erro ao subir o wildFly

Quando tento subir o servidor após as mudanças tenho o seguinte erro:

ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "livraria.war")]) - failure description: { "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.livrariaDS"], "WFLYCTL0180: Services with missing/unavailable dependencies" => [ "jboss.persistenceunit.\"livraria.war#livrariads\" is missing [jboss.naming.context.java.livrariaDS]", "jboss.persistenceunit.\"livraria.war#livrariads\".FIRST_PHASE is missing [jboss.naming.context.java.livrariaDS]" ] } 21:23:23,079 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "livraria.war" (runtime-name : "livraria.war") 21:23:23,088 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report WFLYCTL0184: New missing/unsatisfied dependencies: service jboss.naming.context.java.livrariaDS (missing) dependents: [service jboss.persistenceunit."livraria.war#livrariads".FIRST_PHASE, service jboss.persistenceunit."livraria.war#livrariads"]

Segue o standalone.xml:

 <datasources>
                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                    <driver>h2</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa</password>
                    </security>
                </datasource>
                <datasource jndi-name="java:/livrariaDS" pool-name="livrariaDS"
                enabled="true" use-java-context="true">

                            <connection-url>jdbc:mysql://localhost:3306/livraria</connection-url>
                            <driver>com.mysql</driver>
                            <pool>
                                <min-pool-size>10</min-pool-size>
                                <max-pool-size>100</max-pool-size>
                                <prefill>true</prefill>
                            </pool>
                            <security>
                                <user-name>root</user-name>
                                <password>root</password>
                            </security>
            </datasource>
                <drivers>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>

                    <driver name="com.mysql" module="com.mysql">
                        <xa-datasource-class>
                            com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
                        </xa-datasource-class>

                    </driver>

                </drivers>
            </datasources>

Não sei o q está acontecendo... toda ajuda é bem vinda

Att, Pedro

3 respostas

Bom dia Pedro, tenta colocar o nome do seu DS para:

java:jboss/datasources/livrariaDS

Não funcionou, o erro agora é esse:

08:48:36,418 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "livraria.war")]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.livrariaDS"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.persistenceunit.\"livraria.war#livrariads\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.livrariaDS]",
        "jboss.persistenceunit.\"livraria.war#livrariads\" is missing [jboss.naming.context.java.jboss.datasources.livrariaDS]"
    ]
}

Boa noite. Aparentemente o seu persistence.xml não está vinculando o jta-data-source. Apresente esta parte do persistence.xml, para que possamos lhe ajudar melhor.