You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Kam Lai Wong <kl...@hkem.com> on 2002/10/17 10:41:38 UTC

Cannot create connect to db

Hi, I am now using java beans to connect to xindice

String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
Class c = Class.forName(driver);

Database database = (Database) c.newInstance();
DatabaseManager.registerDatabase(database);
String collectionName = "xmldb:xindice:///db/imail/20011231";
col = DatabaseManager.getCollection(collectionName);
XPathQueryService service = (XPathQueryService) col.getService("XPathQueryService", "1.0");
ResourceSet resultSet = service.query(xql);

However, it prompts the following error:

org.xmldb.api.base.XMLDBException: A connection to the Database instance 'db' could not be created. Error: Cannot create resource URL. Please set the openorb.home property.
        at org.apache.xindice.client.xmldb.DatabaseImpl.init(DatabaseImpl.java:386)
        at org.apache.xindice.client.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:205)
        at org.xmldb.api.DatabaseManager.getCollection(DatabaseManager.java:194)
        at org.xmldb.api.DatabaseManager.getCollection(DatabaseManager.java:157)


I am sure the database is running and the collection is exist!


______________________________________________________
HKDict - the latest and easy to use Online Dictionary
http://www.hkdict.com