Здравствуйте. Делаю программу по
примеру . Вроде добавил в папку deployments jar с драйвером и файл с описанием datasource, но при деплоя на сервер (через отладку в IntelliJ IDEA) у меня пишется ошибка:
23:51:06,611 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "webapp-example-1-1.0-SNAPSHOT.war" was rolled back with the following failure message:
{
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.exampleDS"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"webapp-example-1-1.0-SNAPSHOT.war#examplePU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.exampleDS]",
"jboss.persistenceunit.\"webapp-example-1-1.0-SNAPSHOT.war#examplePU\" is missing [jboss.naming.context.java.jboss.exampleDS]"
]
}
Вот, мой файл с описанием datasource:
<?xml varsion="1.0"?>
<datasources schemaLocation="http://docs.jboss.org/ironjacamar/schema/datasources_1_1.xsd">
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="PostgreSQLPool">
<connection-url>jdbc:postgresql://localhost:5432/example</connection-url>
<driver>postgresql-42.2.5.jar</driver>
<driver-class>org.postgresql.Driver</driver-class>
<pool>
<max-pool-size>30</max-pool-size>
</pool>
<security>
<user-name>postgres</user-name>
<password>1</password>
</security>
<validation>
<check-valid-connection-sql>select 1</check-valid-connection-sql>
</validation>
</datasources>
Состав проекта:
Файл persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
<persistence-unit name="examplePU">
<jta-data-source>java:jboss/exampleDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />
</properties>
</persistence-unit>
</persistence>