我是新手,所以我创建了一个玩具项目,但似乎我在阅读 xml 文件时总是遇到问题:
公共类 testProfusion {
public static void main(String[]args){
Graph graph = null;
try {
graph = new GraphMLReader().readGraph("http://www.w3schools.com/xml/note.xml");
} catch ( DataIOException e ) {
e.printStackTrace();
System.err.println("Error loading graph. Exiting...");
System.exit(1);
}
}
}
地址有效,可以直接访问。但是,无论我如何更改,我总是会收到错误:
at prefuse.data.io.GraphMLReader.readGraph(Unknown Source)
at prefuse.data.io.AbstractGraphReader.readGraph(Unknown Source)
at testProfusion.main(testProfusion.java:13)
Caused by: java.lang.NullPointerException
at prefuse.data.io.GraphMLReader$GraphMLHandler.endDocument(Unknown Source)
请帮我;-)!!!