Here is a quick cheat sheet to the errors:

 interface ErrorCodes {
      // Error Codes are broken into categories

      // General API Errors
      const long UNKNOWN_ERROR = 0;
      const long VENDOR_ERROR = 1;
      const long NOT_IMPLEMENTED = 2;
      const long WRONG_CONTENT_TYPE = 3;
      const long PERMISSION_DENIED = 4;
      const long INVALID_URI = 5;

      // Service errors
      const long NO_SUCH_SERVICE = 100;

      // Collection errors
      const long NO_SUCH_COLLECTION = 200;
      const long INVALID_COLLECTION = 201;
      const long COLLECTION_CLOSED = 202;

      // Resource errors
      const long NO_SUCH_RESOURCE = 300;
      const long INVALID_RESOURCE = 301;
      const long UNKNOWN_RESOURCE_TYPE = 302;

      // Database errors
      const long NO_SUCH_DATABASE = 400;
      const long INVALID_DATABASE = 401;
   };

Richard,
I think yours' is a VENDOR_ERROR ;-).

Mark

Kimbro Staken wrote:

> You're using the dbxml database impl with the Xindice URI.  If you're
> using dbXML then you shouldn't have any mention of xindice, and if you're
> using xindice you shouldn't have any mention of dbXML
>
> BTW, you can find out the error codes here
> http://www.xmldb.org/xapi/idl/base.idl. Also if you print out e.message it
> should give you more information. The error you're seeing is because it
> can't locate the database impl.
>
> Yeah, I know it's confusing right now. We'll get an actual xindice release
> out real soon now and then dbXML can take its place in history.  The main
> holdup is that we need to get the website setup on the Apache side before
> we do the release.
>
> On Tuesday, February 5, 2002, at 10:46 AM, Richard Featherstone wrote:
>
> > I've created the collection and added a few documents.  I've queried the
> > collection from the command line and get the right results.  I'm no
> > trying to do the same thing from a Java program to get to grips with the
> > XML:DB Api.  The code I'm using is below.  Any ideas where I'm going
> > wrong will be gratefully received.
> >
> > Cheers
> >
> > Richard
> >
> > import org.xmldb.api.base.*;
> > import org.xmldb.api.modules.*;
> > import org.xmldb.api.*;
> >
> > public class ConnectToDbxml {
> >
> >     /**  */
> >     public static void main(String args[]) throws Exception {
> >
> >         Collection col = null;
> >
> >         try{
> >             String driver = "org.dbxml.client.xmldb.DatabaseImpl";
> >             Class c = Class.forName(driver);
> >
> >             Database database = (Database)c.newInstance();
> >             DatabaseManager.registerDatabase(database);
> >
> >             col =
> > DatabaseManager.getCollection("xmldb:xindice:///db/myexamples");
> >
> >             String xpath = "/person";
> >             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();
> >             }
> >         }
> >     }
> > }
> >
> > ----- Original Message -----
> > From: Mark J. Stang
> > To: [email protected]
> > Sent: Tuesday, February 05, 2002 5:39 PM
> > Subject: Re: exception error code
> >
> > It means something didn't work :-).   I don't mean that in a bad way,
> > I think you get that error for many different types of problems.
> >
> > Have you created the collection "myexamples"?
> >
> > Try
> >
> > dbxmladmin lc -c /db
> >
> > It should list your collections.
> >
> > Try "getting" one of the ones that are in the list.
> >
> > HTH,
> >
> > Mark
> >
> > Richard Featherstone wrote:
> >
> >  Hi Hope someone can help In a Java program I try and call     col =
> > DatabaseManager.getCollection("xmldb:dbxml:///db/myexamples"); and I get
> >     XML:DB EXCEPTION: occured 1 can anyone tell me what error code 1 is
> > so I can try to trace the problem Cheers Richard
> >
> >
> Kimbro Staken
> XML Database Software, Consulting and Writing
> http://www.xmldatabases.org/

Reply via email to