Galera tenho um projeto que utiliza como persistencia de dados arquivos xml minhas clases são:
private static Document carregarArquivoXML(String nomeArquivo)
throws ParserConfigurationException, SAXException, IOException,
URISyntaxException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringElementContentWhitespace(true);
factory.setValidating(true);
DocumentBuilder builder = DocumentBuilderFactory.newInstance()
.newDocumentBuilder();
return builder.parse(new File(nomeArquivo));
}
/**
* Salva a árvore dom em arquivo xml passando o nome do arquivo e a
* instância de Document.
*
*/
private static void salvarXMLEmArquivo(Document doc, String nomeArquivo)
throws ParserConfigurationException, SAXException, IOException,
URISyntaxException {
// Obtendo uma implementacao de DOMLS
DOMImplementationLS domImpLS = (DOMImplementationLS) doc
.getImplementation().getFeature("LS", "3.0");
// Criando um local para onde o xml sera serializado (arquivo)
LSOutput output = domImpLS.createLSOutput();
// Arquivo XML relativo ao pacote
output.setByteStream(new FileOutputStream(new File(nomeArquivo)));
// Escrevendo xml no arquivo
LSSerializer serializer = domImpLS.createLSSerializer();
serializer.write(doc, output);
}
o caminha dos arquivos estão corretos mais qnd eu coloco o projeto pra rodar aparece um erro:
SEVERE: Servlet.service() for servlet Login threw exception
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source) …
alguem saberia como resolver? Desde já agradeço!