Berkeley XML DB -- arrrggghh!!!
June 01 2004 10:14 PM

After several hours of headaches and some minor tweaking of Makefiles I finally got Berkeley DB XML installed. Required compiling and installing Berkeley DB, Xerces C, and Pathan. Except now... can't run any of the examples.

Running the following command form the examples/java directory:

java -Djava.library.path=/usr/local/BerkeleyDB.4.2/lib/:/usr/local/BerkeleyDBXML.1.2/lib/ -classpath classes:/usr/local/BerkeleyDB.4.2/lib/db.jar:/usr/local/BerkeleyDBXML.1.2/lib/dbxml.jar com.sleepycat.dbxml.examples.gettingStarted.exampleLoadContainer -h dbEnvironment -p ../../xmlData

results in the following exception:

Error loading files into container namespaceExampleData.dbxml Message: Error: XML Indexer: Fatal parse error in document 'Allspice.xml', line 3, char 11.
Parser Error Message: An exception occurred! Type:ArrayIndexOutofBoundsException, Message:The passed index is past the end of the vector Exception in thread "main"
com.sleepycat.dbxml.XmlException: Error: XML Indexer: Fatal parse error in document 'Allspice.xml', line 3, char 11.
Parser Error Message: An exception occurred! Type:ArrayIndexOutofBoundsException, Message:The passed index is past the end of the vector, errcode = UNSUPPORTED_ENCODING
at com.sleepycat.dbxml.dbxml_javaJNI.XmlContainer_putDocument(Native Method)
at com.sleepycat.dbxml.XmlContainer.putDocument(XmlContainer.java:119)
at com.sleepycat.dbxml.examples.gettingStarted.exampleLoadContainer.loadXml Files(exampleLoadContainer.java:166)

Doing some digging I see that Xerces defaults to the UTF-8 encoding and the file the example is trying to load does not specify an encoding. Should work shouldn't it?

I also wrote my own test where I try to load arbitrary XML into the DB. Tried specifying alternative encodings such as iso-8859-1 and utf-8 but I always get the same error message.

Not sure if this is a mac os x thing or what. Arrrghhh! Google hasn't been much help either.

Comments (0), Add Comment