【发布时间】:2016-09-12 03:45:44
【问题描述】:
在构建代号为 one 的移动应用程序时遇到以下错误。
代码在无代号项目中运行
public Actualite[] select(){
try {
ActualiteHandler matchHandler = new ActualiteHandler();
// get a parser object
SAXParser SAXparser = SAXParserFactory.newInstance().newSAXParser();
// get an InputStream from somewhere (could be HttpConnection, for example)
HttpConnection hc = (HttpConnection) Connector.open("http://localhost/abbes/select.php");//people.xml est un exemple
DataInputStream dis = new DataInputStream(hc.openDataInputStream());
dis.toString();
SAXparser.parse(dis, matchHandler);
// display the result
matches = matchHandler.getMatch();
return matches;
} catch (ParserConfigurationException ex) {
ex.printStackTrace();
} catch (SAXException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}
return null;
}
这是错误
error: cannot access File
SAXparser.parse(dis, matchHandler);
class file for java.io.File not found
【问题讨论】:
标签: php xml-parsing java-me codenameone