niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Berkeley DB
Opening container question
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Rupert Woodman
*nix forums beginner


Joined: 21 Jun 2006
Posts: 5

PostPosted: Wed Jun 21, 2006 3:00 pm    Post subject: Opening container question Reply with quote

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

PostPosted: Wed Aug 02, 2006 6:35 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Sat Nov 22, 2008 8:42 pm | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Newbie question: How to forward a domain to a mailbox? leei Postfix 0 Fri Aug 24, 2007 4:55 pm
No new posts configuration question for httpd Karl Wang Apache 1 Fri Jul 21, 2006 2:10 pm
No new posts nim problem/question Ron AIX 0 Fri Jul 21, 2006 1:57 pm
No new posts container for insert/delete + fast index Neal Becker C++ 1 Fri Jul 21, 2006 12:57 pm
No new posts question for JAVA developer who r using postgres sql as b... deepak pal PostgreSQL 1 Fri Jul 21, 2006 9:00 am

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
[ Time: 0.1814s ][ Queries: 16 (0.1111s) ][ GZIP on - Debug on ]