Estou tendo esse erro quanto tendo subir a aplicação depois realizar as configurações do datasource:
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "cadTelefonista.war")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.cadTelefonistaDS"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"cadTelefonista.war#cadTelefonista-dev\" is missing [jboss.naming.context.java.jboss.datasources.cadTelefonistaDS]",
"jboss.persistenceunit.\"cadTelefonista.war#cadTelefonista-dev\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.cadTelefonistaDS]"
]
}
- Estou usando Wildfly 10.1
- Postgres na porta 5435
Meu standalone-full.xml:
<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:jboss/datasources/cadTelefonistaDS" pool-name="cadTelefonistaDS"
enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql://localhost:5435/telefonista_javaee</connection-url>
<connection-property name="DatabaseName">
telefonista_javaee
</connection-property>
<driver>postgresql</driver>
<security>
<user-name>postgres</user-name>
<password>postgre</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
o meu module.xml está em: wildfly-10.1.0.Final\modules\system\layers\base\org\postgresql\main
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
<resources>
<resource-root path="postgresql-42.2.12.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
O meu persistence.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.1" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="cadTelefonista-dev" transaction-type="JTA">
<description>Dev persistence unit</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- java transaction api || JNDI -->
<jta-data-source>java:jboss/datasources/cadTelefonistaDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
</properties>
</persistence-unit>
</persistence>