Michael, because there is no interface to allow GeoTools to discover the data directory of an enclosing GeoServer, the schema cache searches for a suitable cache location starting from the mapping file and searching all ancestor directories for something that looks like a GeoServer data directory: https://github.com/geotools/geotools/blob/master/modules/library/xml/src/main/java/org/geotools/xml/resolver/SchemaCache.java#L420
A directory is recognised as suitable if it contains a subdirectory "app-schema-cache" or it contains all the files "global.xml", "wcs.xml","wfs.xml", and "wms.xml" and both subdirectories "styles" and "workspaces". By manually creating "app-schema-cache", you satisfy the first criterion. Does your data directory contain: (1) all the files "global.xml", "wcs.xml","wfs.xml", and "wms.xml", and (2) both directories "styles" and "workspaces"? It is possible to start GeoServer with an empty data directory. Did you do this? After starting GeoServer once, are any of those files missing? We might need to adjust the test. Kind regards, Ben. On 16/05/17 12:35, Michael Sexton wrote: > Hi Ben > > I’m using GeoSciML Basic 4 > (http://schemas.opengis.net/gsml/4.1/geoSciMLBasic.xsd > <http://schemas.opengis.net/gsml/4.1/geoSciMLBasic.xsd>) > > As far as I can tell, this resolves. But there may be other problems in the > schema documents I am not aware of. > > On the case of exception logs, I get: > > Caused by: java.lang.RuntimeException: Failed to resolve > http://schemas.opengis.net/gsml/4.1/geoSciMLBasic.xsd > at > org.geotools.xml.resolver.SchemaResolver.resolve(SchemaResolver.java:207) > > I inspected this using the debugger in Eclipse, and the problem is that the > following clause in SchemaResolver evaluates to false, because the cache > variable is null. > > // Use download cache. > if (resolvedLocation == null && cache != null) { > resolvedLocation = cache.resolveLocation(location); > } > > After creating the app-schema-cache directory, the cache variable is of type > org.geotools.xml.resolver.SchemaCache and points to the correct directory. > > >> On 16 May 2017, at 8:01 am, Ben Caradoc-Davies <[email protected]> wrote: >> >> Michael, >> >> I just tested with the app-schema tutorial on master and app-schema-cache >> was automatically created as soon as I accessed an app-schema feature type. >> I had to fix the schemaUri because www.geosciml.org was renamed to >> schemas.geosciml.org and there are still broken imports of cgiutilities, but >> I can see the automatic download working. >> >> - What application schema are you using? >> >> - Do you see any exceptions in the logs? >> >> Kind regards, >> Ben. >> >> On 15/05/17 17:59, Michael Sexton wrote: >>> Hi >>> >>> I was trying to build a new GeoServer instance today using 2.10.3, and I >>> found that the app-schema-cache needs to be present before you could import >>> your mapping files. Is this a feature or a bug? I could have sworn that in >>> previous versions (2.9 and previously) the folder was made for you. >>> >>> Thanks >>> >>> Michael >>> ------------------------------------------------------------------------------ >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >>> _______________________________________________ >>> Geoserver-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/geoserver-users >>> >> >> -- >> Ben Caradoc-Davies <[email protected]> >> Director >> Transient Software Limited <http://transient.nz/> >> New Zealand > > -- Ben Caradoc-Davies <[email protected]> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
