My Spring context initialization fails if I am not online due to SAXParseException, with an sniffer I have noticed that XMLSchema.dtd and datatypes.dtd are requested multiple times on tomcat startup and during unit testing. I have read about using catalogs here http://jaxb.java.net/2.2.4-1/docs/catalog.html but don't know how to define one or how could I plug it to my application. Another approach would be using META-INF/spring.schemas but that seems to be for xsd to be used inside Spring configuration, so don't think it would apply.
I found that the request was caused by a <!DOCTYPE
header on the xmldsig-core-schema.xsd that was referenced by my schemas, I don't know what was its use but I removed it for my application. Here is the snipped above the xsd:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
<!ATTLIST schema
xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
<!ENTITY % p ''>
<!ENTITY % s ''>
]>
<!-- ...
-->
<schema ...