Hello everyone, been tinkering with geoserver 2.22.0 (openjdk 11, tomcat 9.0.70, ubuntu 22.04) for a few months now. Most of it works fine except for the performance of tile rendering, so the next step was to use a feature-pregeneralized plugin. After taking a peek at the source code, I was able to set up a Generalizing data store to some degree. However, when publishing layers from mentioned data store nasty error is being displayed:
Caused by: java.io.IOException: Data store named x in workspace y not found at org.geotools.data.gen.PreGeneralizedFeatureSource.dsNotFoundException(PreGeneralizedFeatureSource.java:101) at org.geotools.data.gen.PreGeneralizedFeatureSource.getBaseFeatureSource(PreGeneralizedFeatureSource.java:116) at org.geotools.data.gen.PreGeneralizedFeatureSource.getSchema(PreGeneralizedFeatureSource.java:357) at org.geotools.data.gen.PreGeneralizedFeatureSource.getSchema(PreGeneralizedFeatureSource.java:394) at org.geotools.data.gen.PreGeneralizedFeatureSource.getSchema(PreGeneralizedFeatureSource.java:67) at org.geoserver.catalog.CatalogBuilder.buildFeatureType(CatalogBuilder.java:342) at org.geoserver.catalog.CatalogBuilder.buildFeatureType(CatalogBuilder.java:325) at org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:421) ... After some inspection, it appears that following code is under suspicion: private SimpleFeatureSource getBaseFeatureSource() throws IOException { DataStore ds = repository.dataStore( new NameImpl(info.getDataSourceNameSpace(), info.getDataSourceName())); if (ds == null) dsNotFoundException(info.getDataSourceNameSpace(), info.getDataSourceName()); return ds.getFeatureSource(info.getBaseFeatureName()); } private void dsNotFoundException(String wsName, String dsName) throws IOException { String msg = "Data store named " + dsName; if (wsName != null) msg += " in workspace " + wsName; msg += " not found"; throw new IOException(msg); } Interestingly enough, /geoserver/web/wicket/bookmarkable/org.geoserver.web.data.store. DataAccessEditPage?n&storeName=x&wsName=y (data store edit page) happily opens data store referenced in GeneralizationInfos xml. After digging a little deeper, it surprisingly seems, that geoserver code uses GeoServerApplication().getCatalog() while plugin uses Repository adapter for the same thing. Guessing there are no data stores passed to it, but checking that would be a project of the month. Similar questions regarding feature-pregeneralized errors while using database data stores pop up every couple of years in forums and mailing lists with no answer. Haven't been asked in 2023 yet :) Best regards, Aurimas Kasauskas
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users