From: Houman K. <kho...@we...> - 2004-06-10 20:09:09
|
Hi Everyone, I am a step closer to the solution. I had to comment out this line: // database.setProperty("create-database", "true"); Now it seems I can make a connection to the database. Before I only could make it locally: Collection col = DatabaseManager.getCollection("xmldb:exist:///db"); Alright now my new Class: String driver = "org.exist.xmldb.DatabaseImpl"; Class cl = Class.forName(driver); Database database = (Database) cl.newInstance(); DatabaseManager.registerDatabase(database); Collection col = DatabaseManager.getCollection("xmldb:exist://localhost:8080/db"); XQueryService service = (XQueryService) col.getService("XQueryService", "1.0"); service.setProperty("indent", "yes"); CompiledExpression compiled = service.compile(query); ResourceSet result = service.execute(compiled); <-- Exception ResourceIterator resultset = result.getIterator(); As soon as it tries to compile the query: Exception: Fatal error parsing XML: org.xml.sax.SAXParseException: end tag </HEAD> does not match begin tag <META> Fatal error parsing XML: org.xml.sax.SAXParseException: end tag </A> does not match begin tag <IMG> Fatal error parsing XML: org.xml.sax.SAXParseException: end tag </BODY> does not match begin tag <P> Fatal error parsing XML: org.xml.sax.SAXParseException: end tag </HTML> does not match begin tag <A> Fatal error parsing XML: org.xml.sax.SAXParseException: unexpected end of file found java.lang.NullPointerException at org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:5 0) at org.exist.xmldb.RemoteXPathQueryService.query(RemoteXPathQueryService.java:3 3) at org.exist.xmldb.RemoteXPathQueryService.execute(RemoteXPathQueryService.java :173) at perfanx.eXistClass.<init>(eXistClass.java:78) at perfanx.eXistMain.main(eXistMain.java:66) The query is alright: for $i in collection('/db/ippm')/data/row where ($i/dat = '20000801000000') return <ROW> { $i/tick } { $i/dlay } </ROW> The server is running. The collection name is ippm. Any comments please? Houman |