gnewton / chidley

Convert XML to Go structs / XML to JSON
Apache License 2.0
273 stars 35 forks source link

Generated Java code fails with SAXParseException: 'http' access is not allowed due to restriction set by the accessExternalDTD property #9

Closed gnewton closed 8 years ago

gnewton commented 8 years ago

[org.xml.sax.SAXParseException; systemId: file:/home/gnewton/gocode/src/github.com/gnewton/chidley/xml/ActorPreludeSample.xml; lineNumber: 2; columnNumber: 123; External DTD: Failed to read external DTD 'partwise.dtd', because 'http' access is not allowed due to restriction set by the accessExternalDTD property.]

gnewton commented 8 years ago

Issue fixed: new Exception: Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.musicxml.org/dtds/partwise.dtd

gnewton commented 8 years ago

Exception is only for some dtd urls. Think some http daemons set up to reject user agents that do not look like browsers. Fixed with:

System.setProperty("http.agent", "Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0");

gnewton commented 8 years ago

merged in to master

malavancs commented 1 year ago

Can you share how did you resolve this ? [org.xml.sax.SAXParseException; systemId: file:/home/gnewton/gocode/src/github.com/gnewton/chidley/xml/ActorPreludeSample.xml; lineNumber: 2; columnNumber: 123; External DTD: Failed to read external DTD 'partwise.dtd', because 'http' access is not allowed due to restriction set by the accessExternalDTD property.]