Hi!

I am having an error message:
 Error: Error org.apache.xindice.client.xmldb.DatabaseImpl
when the my program gets to:
 Class c = Class.forName(driver);

I am accessing the program from IE browser not command line
  as is the case with the example RetrieveDocument.java.
I wrote the following code following the example RetrieveDocument.java that
came with xindice:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;
import org.w3c.dom.*;

public class XindiceServlet7 extends HttpServlet {

    // The method corresponding to HTTP GET
    public void doGet(HttpServletRequest request, HttpServletResponse
response)
        throws ServletException, IOException {
         Collection col = null;
         PrintWriter out = response.getWriter();
            try {
                String driver =
"org.apache.xindice.client.xmldb.DatabaseImpl";
                Class c = Class.forName(driver);    /* exception from here*/

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

DatabaseManager.getCollection("xmldb:xindice:///db/addressbook");

                 XMLResource document = (XMLResource)
col.getResource("address");
                 if (document != null) {
                        out.println("Document ");
                } else {
                        out.println("Document not found");
                }
            } catch(Exception e) {
                out.write("Error " + e.getMessage());
            }
            finally {
            }
      }
}


Thanks in advance

Alisemore Ndowora


Reply via email to