M
M
MaxLich2018-10-21 23:54:46
PostgreSQL
MaxLich, 2018-10-21 23:54:46

Weird datasource errors when deploying to jboss (wildfly) 14. What's the problem? How to fix?

Hello. I am making a program by example . It seems that I added a driver jar file and a datasource description file to the deployments folder, but when deploying to the server (through debugging in IntelliJ IDEA), I get an error:


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]"
]
}

Here is my datasource description file:
<?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>

Project composition:
5bcce748f267c111767443.png
persistence.xml file:
<?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>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question