Hi all
I had a look at the loading issue again, by the looks of the changes in the PR, I don’t think it was addressed.
As a reminder, the full stack trace is here:
https://pastebin.com/hHyFEfuk
We see a circularity, the catalog bean is being created, which in turn triggers the GeoServerLoaderProxy,
which calls upon the DataDirectoryGeoServerLoader to actually populate the catalog contents, which
in turn does an extension lookup for EntityResolverProvider, which needs GeoServerImpl (constructor
injection), which in turn has the catalog injected as a property.
Now one might think that would always trigger a circularity, but in my case, the bean creation works fine,
the EntityResolverProvider is injected a GeoServerImpl that is in state of creation, and still does not have
the catalog property set in. The catalog property is actually injected after the calog is loaded, and there
are no issues.
Specifically, I see the following bean creation chain:
geoServer (id 7611) → localWorkspaceCatalog → advertisedCatalog → accessRuleDao → rawCatalog → GeoServerLoaderProxy.postProcessBeforeInitialization → DataDirectoryGeoServerLoader.loadCatalog → entityResolverProvider creation (which is given a GeoServer instance with id 7611) as part of the DataDirectoryGeoServerLoader pre-init phase.
I have attached a customized logging profile that tracks bean creation, which can be used to compare startup sequences.
To run a test, copy the release data directory, add the logging profile and configure it in logging.xml, then run docker
with something like this (adapt the position of your local data dir):
docker run -it --rm -p8080:8080 --mount type=bind,src=/home/aaime/tmp/spring-bean-debug,target=/opt/geoserver_data --env INSTALL_EXTENSIONS=true --env STABLE_EXTENSIONS="ysld,ogcapi-features" [docker.osgeo.org/geoserver:2.27.x](http://docker.osgeo.org/geoserver:2.27.x)
Running the above, I see the following bean and catalog initialization order:
30 043 13:43:03 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'wcs20Extension'
30 043 13:43:03 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'wcs20ServiceTarget'
**30 043 13:43:03 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'geoServer'**
**30 043 13:43:03 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'localWorkspaceCatalog'**
30 043 13:43:03 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'advertisedCatalog'
30 043 13:43:03 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'accessRulesDao'
30 043 13:43:03 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'rawCatalog'
**30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'entityResolverProvider'**
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'wmsCatalogValidator'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'sldHandler'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'sldPackageHandler'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'ysldHandler'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'ysldUomMapper'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'gwcZoomContextFinder'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'gwcGridSetBroker'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'gwcXmlConfig'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'gwcAppCtx'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'gwcXmlConfigResourceProvider'
30 043 13:43:04 CONFIG [gwc.config] - Will look for 'geowebcache.xml' in directory '/opt/geoserver_data/gwc'.
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'GWCGeoServerConfigurationProvider'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'GWCGeoServerRESTConfigurationProvider'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'localWorkspaceCatalog'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'virtualTableCallback'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'cascadedStoredQueryCallback'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'wmtsLoader'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'wfsLoader'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'wmsLoader'
30 043 13:43:04 DEBUG [support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'wcsLoader'
30 043 13:43:04 CONFIG [geoserver.config] - Loading catalog /opt/geoserver_data
30 043 13:43:05 CONFIG [config.datadir] - Catalog and configuration loader uses 16 threads out of 16 available cores.
30 043 13:43:05 CONFIG [config.datadir] - Loaded style raster
30 043 13:43:05 CONFIG [config.datadir] - Loaded style line
30 043 13:43:05 CONFIG [config.datadir] - Loaded style green
30 043 13:43:05 CONFIG [config.datadir] - Loaded style burg
30 043 13:43:05 CONFIG [config.datadir] - Loaded style polygon
30 043 13:43:05 CONFIG [config.datadir] - Loaded style cite_lakes
30 043 13:43:05 CONFIG [config.datadir] - Loaded style poi
30 043 13:43:05 CONFIG [config.datadir] - Loaded style simple_roads
I’ve also attached the full startup logs to this mail.
Jody (or anyone else having startup problems, really) can you share similar logs for your failing startup case?
(attachments)
SPRING_BEAN_LOGGING.xml (3.63 KB)
geoserver.log (157 KB)