I want to use postgresql in Jboss Wildfly Swarm via declaration of datasource. The application startup error message is:
Failed to load module for driver org.postgresq
Content of the main class:
public static void main(String[] args) throws Exception {
Container container = new Container();
container.fraction(new DatasourcesFraction()
.jdbcDriver("postgresql", (d) -> {
d.driverDatasourceClassName("org.postgresql.Driver");
d.xaDatasourceClass("org.postgresql.xa.PGXADataSource");
d.driverModuleName("org.postgresql");
})
.dataSource("ExampleDS", (ds) -> {
ds.driverName("postgresql");
ds.connectionUrl("jdbc:postgresql://localhost:5432/test_db");
ds.userName("sa");
ds.password("sa");
})
);
container.start();
JAXRSDeployment appDeployment = new JAXRSDeployment( container );
appDeployment.addResource(MyResource.class);
container.deploy(appDeployment);
}
Thanks for any help