With a quick scan, I see two problems:
XMLCatalogResolver catalogResolver = new XMLCatalogResolver( new String[]{"catalog.xml"});
If you look at the Javadoc for this method , you can read
directories - list of ordered arrays absolute URIs
which is not what you are using.
Second problem here
Schema schema = factory.newSchema(new StreamSource(ClassLoader .getSystemResourceAsStream("config.xsd")));
You do not set the system identifier for the scheme, so if you have a relative location to import, this will be resolved relative to the current directory of your application instead of the directory in which you have the scheme file. You need to either call setSystemId in the source, or pass in the system identifier when creating it:
new StreamSource(ClassLoader.getSystemResource("config.xsd").toString())
George Bina
source share