0

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.

ilcavero
  • 3,012
  • 1
  • 31
  • 27
  • Check [this SO QA](http://stackoverflow.com/questions/1729307/spring-schemalocation-fails-when-there-is-no-internet-connection) out – ring bearer Apr 05 '12 at 19:58
  • that's for custom schemas on the application context, what I need are for the XSD referenced by the XSD I created for the marshalling, do you think it still applies? – ilcavero Apr 05 '12 at 22:02

1 Answers1

0

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 ...
ilcavero
  • 3,012
  • 1
  • 31
  • 27