I once tried to access a collection that I hadn't created yet.
I received a nullpointer exception as i tried to create a resource under
my Collection col variable. (Col had not been given a value as the
collection couldn't be found.)So the error here is not consistent with
what you would get trying to access a non-existing collection.

I would think this has to do with your classpath. If you read the
Developers Guide theres a section on how to set up your environment there.

�yvind

�yvind Vestavik
�vre M�llenberggt 44b
7014 Trondheim
[EMAIL PROTECTED]
41422911

On Fri, 1 Feb 2002, Mark J. Stang wrote:

> Alex,
> Unless you created the collection "root", it doesn't exist.   The
> default used to be it was there automatically.   I believe the installation
> no longer creates it.   Try listing the collections to see if it is there.
> Or
> add a collection to be sure it is there.
>
> HTH,
> Mark
>
> Alexander Schatten wrote:
>
> > I fail to write a simple java application accessing dbXML/XIncice:
> >
> > (1) I start dbxml on localhost
> >
> > (2) I try to connect to the database using this code:
> >
> >      org.xmldb.api.base.Collection col = null;
> >      try {
> >        Class c = Class.forName("");
> >
> >        Database database = (Database) c.newInstance();
> >        DatabaseManager.registerDatabase(database);
> >        col =
> > DatabaseManager.getCollection("xmldb:dbxml://localhost:4080/db/root");
> >
> > ...
> > ...
> >
> > I receive an exception. btw. I tried a lot of different URIs also
> > xmldb:dbxml:///db and so on.
> >
> > "org.xmldb.api.base.XMLDBException: A connection to the Database
> > instance 'db' could not be created. Error: http://localhost:4080/db.ior";
> >
> > (3) sometimes I receive an error (even with the method from the
> > documentation):
> >
> > java.lang.NoClassDefFoundError: org/dbxml/server/dbXMLException
> >
> > I searched through the jars and found neither this class, nor the server
> > package...? so even the example programs will not work???
> >
> > please can anyone give me assistance?
> >
> > thank you
> >
> > Alex
> >
> > btw.: I found no place in the documentation where is explained which
> > jars have to be added to the classpath when writing a java application...
>

Reply via email to