Justin,

I have fixed this problem. The root cause is a piece of rather nasty 
xml-commons-resolver default behaviour, which I am reporting here as a 
warning to anyone else who might be using its OASIS Catalog support.

http://jira.codehaus.org/browse/GEOT-2497
"The problem is that xml-commons-resolver CatalogManager by default 
provides a single static Catalog, so when multiple Catalogs are 
requested, the same single instance is returned. This was causing the 
Catalog to contain stale entries from deleted mock data of previous 
tests. The solution is to use CatalogManager.setUseStaticCatalog(false) 
to configure CatalogManager, then create the catalog with 
CatalogManager.getCatalog(), which returns a private catalog each time 
it is called. This resolves the issue. Because only app-schema uses 
Catalog, only app-schema is affected."

Kind regards,
Ben.

Ben Caradoc-Davies wrote:
> Justin,
> 
> I have one module with two unit tests that each pass if run by
> themselves Each test uses a separate instance of the GeoServer
> OneTimeTestSetup infrastructure, and each sets up a different mock
> GeoServer data directory, which contains an OASIS catalog. Each data
> directory is removed when the corresponding test is complete.
> 
> Whenever both tests are run in a single JVM (from Eclipse or from
> Maven), the second fails in the XSD schema resolver. Each test runs fine
> when run in its own JVM. Both tests run fine together if I disable the
> deletion of the mock data. This suggests that the XSD schema resolver is
> hanging on to a cached reference to a schema in a mock directory that
> has been removed.
> 
> - Does the XSD resolver cache URIs? (The method createURIWithCache is
> rather suggestive.)
> 
> - If so, how can I purge this cache?
> 
> Either way, it looks like this cache is not being purged at GeoServer
> shutdown.
> 
> The error is the same as for this old issue:
> http://jira.codehaus.org/browse/GEOT-1635
> but in this case the catalog works fine for each test by itself, so I
> cam confident that the configuration dependencies are correct.
> 
> Kind regards,
> Ben.


-- 
Ben Caradoc-Davies <[email protected]>
Software Engineer, CSIRO Exploration and Mining
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to