Spring's Jaxb2Marshaller fails without network connectivity

Go To StackoverFlow.com

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.

2012-04-05 16:48
by ilcavero
Check this SO QA ou - ring bearer 2012-04-05 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 2012-04-05 22:02


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 ...
2012-04-17 15:56
by ilcavero
Ads