|
|
|
|
|
|
| Author |
Message |
Rupert Woodman *nix forums beginner
Joined: 21 Jun 2006
Posts: 5
|
Posted: Wed Jun 21, 2006 3:00 pm Post subject:
Opening container question
|
|
|
Hi,
I'm just having a look at BerkeleyDB XML for the first time, using the Java
API.
I created a new container using the Berkeley DB XML Shell (Tests.dbxml)
using the command:
createContainer "Tests.dbxml"
I then wrote an application to open the container, but I get an exception
thrown:
Container - Tests.dbxml - container closed.
com.sleepycat.dbxml.XmlException: Error: No such file or directory, errcode
= DATABASE_ERROR
at com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_openContainer__SWIG_2(Native
Method)
at com.sleepycat.dbxml.XmlManager.openContainer(XmlManager.java:473)
at com.sleepycat.dbxml.XmlManager.openContainer(XmlManager.java:187)
at com.sleepycat.dbxml.XmlManager.openContainer(XmlManager.java:131)
at com.microfocus.XMLRepository.dbExample.<init>(dbExample.java:40)
at com.microfocus.XMLRepository.dbExample.main(dbExample.java:52)
If I call the existsContainer method before I make the call to
openContainer, it returns a value of 5.
However, if I create a container ("Test.xml") using
XmlManager.createContainer method, the same openContainer method, it works
ok.
I'm sure I must be missing something obviosu here, but I've not found
anything in the docs I've read so far.
thanks very much
Code below:
try {
File f = new File("c:/Documents and Settings/rupertw/");
String strContainer = "Tests.dbxml";
EnvironmentConfig envConf = new EnvironmentConfig();
envConf.setCacheSize(50 * 1024 * 1024);
envConf.setInitializeCache(true);
envConf.setInitializeLogging(true);
envConf.setErrorStream(System.err);
Environment myEnv = new Environment(f, envConf);
xmManager = new XmlManager(myEnv, null);
xmManager.setLogLevel(XmlManager.LEVEL_ALL, true);
xmManager.setLogCategory(XmlManager.CATEGORY_ALL, true);
System.err.println("existsContainer returns: " +
xmManager.existsContainer(strContainer));
XmlContainer x = xmManager.openContainer(strContainer);
System.err.println("Opened ok");
} catch (XmlException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} |
|
| Back to top |
|
 |
nithyanirmal *nix forums beginner
Joined: 02 Aug 2006
Posts: 1
|
Posted: Wed Aug 02, 2006 6:35 pm Post subject:
|
|
|
I am having the same problem. the first time I created the container it worked fine. From second time to access the container, I am getting errors:
manager.openContainer("container name") throws the following Exception:
servicecom.sleepycat.dbxml.XmlException: Error: No such file or directory, errcode = DATABASE_ERROR
while
manger.createContaienr("container name") throws the following Exception:
servicecom.sleepycat.dbxml.XmlException: Error: File exists, errcode = CONTAINER_EXISTS
Any suggestions welcome. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sat Nov 22, 2008 8:42 pm | All times are GMT
|
|
Loans | Photo Gallery | Debt Consolidation | Outsourcing | Quality Hosting - Affordable Prices
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|