0 Replies Latest reply on Dec 4, 2015 6:35 AM by jonmiran

    Failed to load module for driver org.postgresq using swarm

    jonmiran

      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