You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Laurent Yew <dr...@yahoo.com> on 2005/01/11 16:27:05 UTC

problem with example

hi everyone. i was trying with the java examples but i
got errors. could someone please help me

package org.apache.xindice.examples;

import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;

public class Example1 {

public static void main(String[] args) throws
Exception {
  Collection col = null;
  try {
    String driver =
"org.apache.xindice.client.xmldb.DatabaseImpl";
    Class c = Class.forName(driver);

    Database database = (Database) c.newInstance();
    DatabaseManager.registerDatabase(database);

    String uri = "xmldb:xindice:///db/addressbook";
    col = DatabaseManager.getCollection(uri);

    String xpath = "//person[fname='John']";
    XPathQueryService service =
      (XPathQueryService)
col.getService("XPathQueryService", "1.0");
    ResourceSet resultSet = service.query(xpath);
    ResourceIterator results =
resultSet.getIterator();
    while (results.hasMoreResources()) {
      Resource res = results.nextResource();
      System.out.println((String) res.getContent());
    }
  } catch (XMLDBException e) {
    System.err.println("XML:DB Exception occured " +
e.errorCode);
  } finally {
    if (col != null) {
      col.close();
    }
  }
}

}

got the errors

java.lang.AbstractMethodError:
org.apache.xindice.client.xmldb.DatabaseImpl.getNames()[Ljava/lang/String;

	at
org.xmldb.api.DatabaseManager.registerDatabase(Unknown
Source)

	at xindicetest1.main(xindicetest1.java:16)

Exception in thread "main" 


		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com