I am a newbie at defining and connecting a datasource in wildfly.
I am running postgresql16-16.8-1 on Fedora F42.
I am running wildfly v35.
Wildfly v35 requires Jakarta EE 10.
My wildfly base config file is standalone.xml
When I attempt to start wildfly, I get the following:
2025-04-16 16:03:35,656 INFO [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBossWS 7.3.1.Final (Apache CXF 4.0.5)
2025-04-16 16:03:35,659 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "manchesterDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.postgresql"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"service org.wildfly.data-source.manchesterDS is missing [jboss.jdbc-driver.postgresql]",
"service jboss.driver-demander.java:jboss/datasources/manchesterDS is missing [jboss.jdbc-driver.postgresql]"
]
}
2025-04-16 16:03:35,685 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "manchesterDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.postgresql",
"jboss.jdbc-driver.postgresql"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"service org.wildfly.data-source.manchesterDS is missing [jboss.jdbc-driver.postgresql]",
"service jboss.driver-demander.java:jboss/datasources/manchesterDS is missing [jboss.jdbc-driver.postgresql]",
"service org.wildfly.data-source.manchesterDS is missing [jboss.jdbc-driver.postgresql]"
]
}
2025-04-16 16:03:35,689 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.postgresql (missing) dependents: [service org.wildfly.data-source.manchesterDS, service jboss.driver-demander.java:jboss/datasources/manchesterDS]
WFLYCTL0448: 2 additional services are down due to their dependencies being missing or failed
2025-04-16 16:03:35,716 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
The following is the datasources snippet from standalone.xml:
<subsystem xmlns="urn:jboss:domain:datasources:7.2">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=${wildfly.h2.compatibility.mode:REGULAR}</connection-url>
<driver>h2</driver>
<security user-name="sa" password="sa"/>
</datasource>
<datasource jndi-name="java:jboss/datasources/manchesterDS" pool-name="manchesterDS">
<connection-url>jdbc:postgresql://localhost:5432/postgresql</connection-url>
<driver>postgresql</driver>
<security user-name="<redacted>" password="redacted"/>
</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">
<driver-class>org.postgresql.Driver</driver-class>
</driver>
</drivers>
</datasources>
</subsystem>
My /opt/wildfly/modules/system/layers/base/org/postgresql/main/module.xml follows:
<?xml version="1.0"/>
<module xmlns="url:jboss:module:1.0"
name="org.postgresql"
>
<resources>
<resource-root path="postgresql.jar"/>
</resources>
<dependencies>
<module name="jakarta.api"/>
<module name="jakarta.transaction.api"/>
<module name="jakarta.servlet.api"
optional="true"
/>
</dependencies>
</module>
ls /opt/wildfly/modules/system/layers/base/org/postgresql/main
module.xml postgresql.jar postgresql-jdbc.jar
Any suggestions would be greatly appreciated.