Hello,

I use geotools for accessing a postigs-db. This works fine in a standalone java 
application. But in doesn't in a wildfly application.
In pom.xml the dependency is included:

    <dependency>
     <groupId>org.geotools.jdbc</groupId>
     <artifactId>gt-jdbc-postgis</artifactId>
    </dependency>

I use the following sample code (internal values replaced by X)

    Map<String, Object> params = new HashMap<>();
    params.put("dbtype", "postgis");
    params.put("host", "X.X.X.X");
    params.put("port", 5432);
    params.put("schema", "gis");
    params.put("database", "postgis");
    params.put("user", "XXX");
    params.put("passwd", "XXX");

    DataStore store = DataStoreFinder.getDataStore(params);
    System.out.println("params" + params);
    System.out.println("store:" + store);

    Iterator it = DataStoreFinder.getAvailableDataStores();
    while(it.hasNext()){
      System.out.println(it.next());
    }


In a Standalone java application the output is the following:
params{schema=gis, database=postgis, port=5432, passwd=XXX, dbtype=postgis, 
host=X.X.X.X, user=XXX}
store:org.geotools.jdbc.JDBCDataStore@4516af24
org.geotools.data.postgis.PostgisNGDataStoreFactory@35bbe5e8
org.geotools.data.postgis.PostgisNGJNDIDataStoreFactory@2d209079

running the same in a wilfly application returns:

params: {schema=gis, database=postgis, port=5432, passwd=XXX, dbtype=postgis, 
host=X.X.X.X, user=XXX}
store:null
org.geotools.data.postgis.PostgisNGJNDIDataStoreFactory@19230b4d

Why is store null in second case? Why is there only one StoreFinder in second 
case, but two StoreFinder in first case?

I'm using geotools 20.1, java 8, wildfly 10.1

Thank you for any ideas.

Stefan
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to