I'm trying to parse an XML file in Java using the DOM parser with the following code:
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
[...]
File file = new File("some/path");
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(file);
And the last line (when calling the .parse() func) is giving the error:
java.io.IOException: Server returned HTTP response code: 403 for URL: http://testng.org/testng-1.0.dtd
How do I go about fixing this error?