Problem to retrieve a document within a java class

"Pasche" <[email protected]>
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
I´m running Xindice 1.1b4 on Tomcat 4.1.24. If I try to retrieve a document
via console, I have no problems. Now I tried to search for a document within
a java class:

 

import org.xmldb.api.base.*;

import org.xmldb.api.modules.*;

import org.xmldb.api.*;

 

public class Read {

   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);

 

         col =
DatabaseManager.getCollection("xmldb:xindice://localhost:8080/db/test");

 

         String xpath = "/output/ART/A0/SSTW";

         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 occurred " + e.errorCode);

      }

      finally {

         if (col != null) {

            col.close();

         }

      }

   }

} 

 

If I try to run this program, I get the following errors and have no idea
where it comes from.

 

java.lang.ClassNotFoundException:
org.apache.xindice.client.xmldb.DatabaseImpl

      at java.net.URLClassLoader$1.run(Unknown Source)

      at java.security.AccessController.doPrivileged(Native Method)

      at java.net.URLClassLoader.findClass(Unknown Source)

      at java.lang.ClassLoader.loadClass(Unknown Source)

      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

      at java.lang.ClassLoader.loadClass(Unknown Source)

      at java.lang.ClassLoader.loadClassInternal(Unknown Source)

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Unknown Source)

      at main.Read.main(Read.java:24)

Exception in thread "main"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.