This is caused by your program not finding the "driver" class. Your
web-application should contain a directory "lib" where it could find the
driver, or you could start your application container in a way its CLASSPATH
points to it.
jmt
On Friday 24 January 2003 18:08, FTL Africa wrote:
> 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