Hi
Things I left out: A modules/core/src/schema/XMLSchema.dtd A modules/core/src/schema/datatypes.dtd
these don't seem to be needed(?) Is this due to removing the error handling exceptions from LoaderUtil? Would the schema schema work as well or would this result in circular dependencies?
see below.
Things I changed: --commented out some tests in LocalEntityResolverTest that fail. Did you not include some files in localresolverrepository into the patch? Apparently the catalog is claiming files exist, that don't.
I can't find the test in CVS. Have you commited the file?
There should be a folder called 'localresolverrepository' with one file 'some.xsd'. This is a dummy file and should only exist. The content is never used. I included in the patch.
(I attached a file 'localresolverrepository.zip' which should be exctracted to test-data/xml/deployment)
The file is used inside the 'testLocalRepository' method (LocalEntityResolverTest.java). As I said before this test method looks like a direct file access ('/home/kkoehler/some.xsd'). But this is only the test for stripping a String (see getSystemIdFileName in LocalEntityResolver). In the past I had problems when using windows. So I think I add a test for reading/using unix and windows path expressions.
-- used the jaxp-based method in LoaderUtil. I don't see any more or less errors with it. (Is this due to removing exceptions from errorhandler?)
The jaxp-based method doesn't validate xml files with dtds.
I added a test for that inside the LoaderUtil test ('testParseNoneValidXML'). I'm not sure how to handle this exception correctly (parsing the message is not a good idea i think ;-) ). If the jaxp-based method is used an SAXParserException with the message 'Cannot find the declaration of element 'web-app'' is thrown. If the Xerces specific method is used an exception with the message "Element type "descriptio" must be declared." is thrown. For me this looks like the jaxp-compliant method doesn't validate using the dtd. It only validates against schemas.
I will add a second test with a valid xml file. The compliant variant will still throw an exception.
-- replaced the exceptions on parse errors with logging in the error handler, so other tests will pass, pending fixing the schema issues.
+1 ;-)
--commented out the contents of resolver-catalog.xml pending actually installing them. The web 2.3 dtd is not actually in our source tree.
See: /specs/servlet/src/schema/web-app_2_3.dtd
src/test/org/apache/geronimo/xml/deployment/AbstractLoaderUtilTest.java
I removed the 'resolver.setFailOnUnresolvable(false)' call. I think if a test needs a dtd or schema this file should be on the local file system (and in cvs). (This was the reason for me to write that patch ;-) ). And for that matter the two files:
modules/core/src/schema/XMLSchema.dtd modules/core/src/schema/datatypes.dtd
should be present. They are needed to validate against a schema. I'm not sure what you mean with 'circular dependencies'. The two files come from the W3C.
TODO: 1. (Most important) Resolve the issues with geronimo schemas being invalid.
Add this to Jira? I'm not sure if they are invalid?
2. Figure out how to get the sun schemas into the catalog.
I think a local repository (etc/xml) for dtd and schema would be very helpful. That's more transparent than including this files into a jar file.
I think there will at most 10 schemas to add. This could be done very quickly.
3. Replace the static field way of setting the entity resolver on Loader/StorerUtil with a jmx way. (I expect to do this shortly) 4. Consider if we want to preload and parse all plausible schemas in a xerces-specific way as discussed here: http://xml.apache.org/xerces2-j/faq-grammars.html
I could do that after my holiday next week. I think this is not so important at the moment. ;-)
src/test-data/xml/deployment/connector_1_0/ra.xml src/test-data/xml/deployment/connector_1_5/ra.xml I have added dtd and schema statements to validate the files.
src/test-data/xml/deployment/resolver-catalog.xml
Added the XMLSchema and datatypes files to pass the tests (failOnUnresolvable).
src/test/org/apache/geronimo/xml/deployment/LoaderUtilTest.java Just added the test method. I removed all tabs ;-) Sorry.
I will post the patch to jira.
Kristian