BerkeleyDB LOG_INTEGRITY errors

Greetings!
We run BerkeleyDB embedded in our java application. Everything runs fine normally. Trouble happens if we run two instances of the same application. The folders where database files are created are separate for both. But it seems that when one stops something deletes the database files of the running one and it crashes.
A little more detail on how we run things:
init.d script (1) --> Starts a python module as root (2) ---> Starts a Java program as a regular user (3) ---> Forks off java programs that use individual instances of BerkeleyDB (4)
So if we start (3) manually things seem to run fine even if we have two instances of 4. It is only when the full thing runs that the error happens - the first process runs fine, the second process starts and completes and then the first process crashes because the entire content of its database folder is gone.
One more observation - if we set up the HOME environment variable to "/root" before starting (3) above - things do not fail. We cannot do that for obvious reasons, but this is something we found by chance.
The stack trace is attached below. If anyone can throw some light on what may be causing this that will be very very helpful.
Regards,
Arnab.
Caused by: com.sleepycat.je.EnvironmentFailureException: (JE 5.0.103) Environment must be closed, caused by: com.sleepycat.je.EnvironmentFailureException: Environment invalid because of previous exception: (JE 5.0.103) db com.sleepycat.je.EnvironmentFailureException: (JE 5.0.103) db java.io.FileNotFoundException: db/00000001.jdb (No such file or directory) LOG_INTEGRITY: Log information is incorrect, problem is likely persistent. UNEXPECTED_EXCEPTION_FATAL: Unexpected internal Exception, unable to continue. Environment is invalid and must be closed.
        at com.sleepycat.je.EnvironmentFailureException.wrapSelf(EnvironmentFailureException.java:246)
        at com.sleepycat.je.dbi.EnvironmentImpl.checkIfInvalid(EnvironmentImpl.java:1618)
        at com.sleepycat.je.dbi.CursorImpl.checkEnv(CursorImpl.java:2859)
        at com.sleepycat.je.Cursor.checkEnv(Cursor.java:4181)
        at com.sleepycat.je.Cursor.close(Cursor.java:517)
        at com.sleepycat.je.Database.putInternal(Database.java:1584)
        at com.sleepycat.je.Database.put(Database.java:1448)
        at com.veracode.webscan.scanner.BerkeleyDbStorage$Db.put(BerkeleyDbStorage.java:585)
        at com.veracode.webscan.scanner.BerkeleyDbStorage$Db.put(BerkeleyDbStorage.java:615)
        at com.veracode.webscan.scanner.BerkeleyDbStorage$Db.access$3400(BerkeleyDbStorage.java:568)
        at com.veracode.webscan.scanner.BerkeleyDbStorage$NodeProviderImpl.setProp(BerkeleyDbStorage.java:850)
        at com.veracode.webscan.scanner.BerkeleyDbStorage$Node.setProp(BerkeleyDbStorage.java:148)
        at com.veracode.dscancommon.util.BaseMutablePropsAsMutableProps.setProp(BaseMutablePropsAsMutableProps.java:62)
        ... 34 more
Caused by: com.sleepycat.je.EnvironmentFailureException: Environment invalid because of previous exception: (JE 5.0.103) db com.sleepycat.je.EnvironmentFailureException: (JE 5.0.103) db java.io.FileNotFoundException: db/00000001.jdb (No such file or directory) LOG_INTEGRITY: Log information is incorrect, problem is likely persistent. UNEXPECTED_EXCEPTION_FATAL: Unexpected internal Exception, unable to continue. Environment is invalid and must be closed.
        at com.sleepycat.je.EnvironmentFailureException.unexpectedException(EnvironmentFailureException.java:351)
        at com.sleepycat.je.log.LogBufferPool.writeBufferToFile(LogBufferPool.java:443)
        at com.sleepycat.je.log.LogBufferPool.writeDirty(LogBufferPool.java:370)
        at com.sleepycat.je.log.LogManager.multiLog(LogManager.java:426)
        at com.sleepycat.je.log.LogManager.log(LogManager.java:350)
        at com.sleepycat.je.tree.IN.logInternal(IN.java:3547)
        at com.sleepycat.je.tree.IN.optionalLog(IN.java:3494)
        at com.sleepycat.je.tree.IN.splitInternal(IN.java:2737)
        at com.sleepycat.je.tree.IN.split(IN.java:2535)
        at com.sleepycat.je.tree.Tree.forceSplit(Tree.java:1992)
        at com.sleepycat.je.tree.Tree.searchSubTreeSplitsAllowed(Tree.java:1768)
        at com.sleepycat.je.tree.Tree.searchSplitsAllowed(Tree.java:1318)
        at com.sleepycat.je.tree.Tree.findBinForInsert(Tree.java:2246)
        at com.sleepycat.je.dbi.CursorImpl.putInternal(CursorImpl.java:875)
        at com.sleepycat.je.dbi.CursorImpl.put(CursorImpl.java:816)
        at com.sleepycat.je.Cursor.putAllowPhantoms(Cursor.java:2397)
        at com.sleepycat.je.Cursor.putNoNotify(Cursor.java:2352)
        at com.sleepycat.je.Cursor.putNotify(Cursor.java:2260)
        at com.sleepycat.je.Cursor.putNoDups(Cursor.java:2149)
        at com.sleepycat.je.Cursor.putInternal(Cursor.java:2117)
        at com.sleepycat.je.Database.putInternal(Database.java:1580)
        ... 41 more
Caused by: com.sleepycat.je.EnvironmentFailureException: (JE 5.0.103) db java.io.FileNotFoundException: db/00000001.jdb (No such file or directory) LOG_INTEGRITY: Log information is incorrect, problem is likely persistent.
        at com.sleepycat.je.log.FileManager$LogEndFileDescriptor.getWritableFile(FileManager.java:2981)
        at com.sleepycat.je.log.FileManager$LogEndFileDescriptor.access$200(FileManager.java:2682)
        at com.sleepycat.je.log.FileManager.writeLogBuffer(FileManager.java:1607)
        at com.sleepycat.je.log.LogBufferPool.writeBufferToFile(LogBufferPool.java:411)
        ... 60 more
Caused by: java.io.FileNotFoundException: db/00000001.jdb (No such file or directory)
        at java.io.RandomAccessFile.open(Native Method)
        at java.io.RandomAccessFile.<init>(Unknown Source)
        at java.io.RandomAccessFile.<init>(Unknown Source)
        at com.sleepycat.je.log.FileManager$DefaultRandomAccessFile.<init>(FileManager.java:3181)
        at com.sleepycat.je.log.FileManager$6.createFile(FileManager.java:3209)
        at com.sleepycat.je.log.FileManager.openFileHandle(FileManager.java:1278)
        at com.sleepycat.je.log.FileManager.makeFileHandle(FileManager.java:1245)
        at com.sleepycat.je.log.FileManager.access$1500(FileManager.java:76)
        at com.sleepycat.je.log.FileManager$LogEndFileDescriptor.getWritableFile(FileManager.java:2959)
        ... 63 more

Based on your description I'm guessing that either your script/app or something external is deleting the files.  It is very unlikely that JE is deleting all the files in the environment directory.  We've never had a report of such a problem anyway, and it's difficult for me to imagine how it could happen.  For example, JE never cleans/deletes the two most recent files.
I should also mention that we do not certify the product on Windows, so there is a possibility that you're running into a file locking issue that we don't know about.  Normally JE uses a lock file to ensure that only one JE process (JVM instance) can write to a given directory.  If you are accidentally allowing two JVMs to write to the same directory, and Windows file locking is misbehaving, that might cause the problem.  However, I think this is unlikely.
--mark

Similar Messages

  • Greylisting / Howto

    Hi,
    I am trying to install the greylisting whith the howto published by Topicdesk.
    I am having issues install berkeleydb. Here is the error message (part of it it's so long I am not getting the top of the error message...
    BerkeleyDB.c:6656: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6712: error: 'RETVAL' undeclared (first use in this function)
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor__cclose':
    BerkeleyDB.c:6725: error: syntax error before 'db'
    BerkeleyDB.xs:4614: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4614: error: syntax error before ')' token
    BerkeleyDB.c:6729: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6732: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6735: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6752: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_DESTROY':
    BerkeleyDB.c:6766: error: syntax error before 'db'
    BerkeleyDB.xs:4632: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4632: error: syntax error before ')' token
    BerkeleyDB.c:6772: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6775: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursorstatus':
    BerkeleyDB.c:6803: error: syntax error before 'db'
    BerkeleyDB.xs:4649: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4649: error: syntax error before ')' token
    BerkeleyDB.c:6807: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6810: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6813: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6821: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_cdel':
    BerkeleyDB.c:6837: error: syntax error before 'db'
    BerkeleyDB.xs:4662: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4662: error: syntax error before ')' token
    BerkeleyDB.c:6841: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6850: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6853: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6864: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_cget':
    BerkeleyDB.c:6880: error: syntax error before 'db'
    BerkeleyDB.xs:4678: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4678: error: syntax error before ')' token
    BerkeleyDB.c:6886: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6895: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6898: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6909: error: 'DBOPFLAGSMASK' undeclared (first use in this function)
    BerkeleyDB.c:6909: error: 'DBSETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:6912: error: 'dbrecnot' undeclared (first use in this function)
    BerkeleyDB.c:6922: error: 'DBGETBOTH' undeclared (first use in this function)
    BerkeleyDB.c:6929: error: 'DBT_B' has no member named 'flags'
    BerkeleyDB.c:6930: error: 'DBT_B' has no member named 'dlen'
    BerkeleyDB.c:6931: error: 'DBT_B' has no member named 'doff'
    BerkeleyDB.xs:4685: error: 'DBT_B' has no member named 'flags'
    BerkeleyDB.xs:4685: error: 'DBT_B' has no member named 'dlen'
    BerkeleyDB.xs:4685: error: 'DBT_B' has no member named 'doff'
    BerkeleyDB.c:6944: error: 'DBGETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:6946: error: 'DBJOINITEM' undeclared (first use in this function)
    BerkeleyDB.c:6949: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_cpget':
    BerkeleyDB.c:6965: error: syntax error before 'db'
    BerkeleyDB.c:6195: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Common_dbsync':
    BerkeleyDB.c:6221: error: syntax error before 'db'
    BerkeleyDB.xs:4365: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4365: error: syntax error before ')' token
    BerkeleyDB.c:6225: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6234: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6237: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:6248: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Common_Txn':
    BerkeleyDB.c:6262: error: syntax error before 'db'
    BerkeleyDB.xs:4375: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4375: error: syntax error before ')' token
    BerkeleyDB.c:6269: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6272: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:6278: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.c:6284: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Commontruncate':
    BerkeleyDB.c:6317: error: syntax error before 'db'
    BerkeleyDB.xs:4398: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4398: error: syntax error before ')' token
    BerkeleyDB.c:6323: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6326: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6329: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:6354: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Commonassociate':
    BerkeleyDB.c:6375: error: syntax error before 'db'
    BerkeleyDB.xs:4426: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4426: error: syntax error before ')' token
    BerkeleyDB.c:6382: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6385: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6388: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:6394: error: 'secondary' undeclared (first use in this function)
    BerkeleyDB.c:6397: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:6427: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Common_associateforeign':
    BerkeleyDB.c:6443: error: syntax error before 'db'
    BerkeleyDB.xs:4457: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4457: error: syntax error before ')' token
    BerkeleyDB.c:6451: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6454: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6457: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:6463: error: 'secondary' undeclared (first use in this function)
    BerkeleyDB.c:6466: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:6492: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Commoncompact':
    BerkeleyDB.xs:4483: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4483: error: syntax error before ')' token
    BerkeleyDB.xs:4485: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6512: error: syntax error before 'db'
    BerkeleyDB.c:6521: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6524: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:6621: error: 'DBOPFLAGSMASK' undeclared (first use in this function)
    BerkeleyDB.c:6621: error: 'DBGETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:6624: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor__cdup':
    BerkeleyDB.c:6639: error: syntax error before 'db'
    BerkeleyDB.xs:4556: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4556: error: syntax error before ')' token
    BerkeleyDB.c:6644: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6653: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6656: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6712: error: 'RETVAL' undeclared (first use in this function)
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor__cclose':
    BerkeleyDB.c:6725: error: syntax error before 'db'
    BerkeleyDB.xs:4614: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4614: error: syntax error before ')' token
    BerkeleyDB.xs:4701: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4701: error: syntax error before ')' token
    BerkeleyDB.c:6972: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6981: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6984: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6995: error: 'DBOPFLAGSMASK' undeclared (first use in this function)
    BerkeleyDB.c:6995: error: 'DBSETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:6998: error: 'dbrecnot' undeclared (first use in this function)
    BerkeleyDB.c:7008: error: 'DBGETBOTH' undeclared (first use in this function)
    BerkeleyDB.c:7015: error: 'DBT_B' has no member named 'flags'
    BerkeleyDB.c:7016: error: 'DBT_B' has no member named 'dlen'
    BerkeleyDB.c:7017: error: 'DBT_B' has no member named 'doff'
    BerkeleyDB.c:7032: error: 'DBGETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:7040: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_cput':
    BerkeleyDB.c:7056: error: syntax error before 'db'
    BerkeleyDB.xs:4730: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4730: error: syntax error before ')' token
    BerkeleyDB.c:7062: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7071: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:7074: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6729: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6732: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6735: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6752: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_DESTROY':
    BerkeleyDB.c:6766: error: syntax error before 'db'
    BerkeleyDB.xs:4632: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4632: error: syntax error before ')' token
    BerkeleyDB.c:6772: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6775: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursorstatus':
    BerkeleyDB.c:6803: error: syntax error before 'db'
    BerkeleyDB.xs:4649: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4649: error: syntax error before ')' token
    BerkeleyDB.c:6807: warning: ISO C90 forbids mixed declarations andBerkeleyDB.c:7087: error: 'dbrecnot' undeclared (first use in this function)
    BerkeleyDB.c:7104: error: 'DBT' has no member named 'flags'
    BerkeleyDB.c:7105: error: 'DBT' has no member named 'dlen'
    BerkeleyDB.c:7106: error: 'DBT' has no member named 'doff'
    BerkeleyDB.c:7116: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_ccount':
    BerkeleyDB.c:7132: error: syntax error before 'db'
    BerkeleyDB.xs:4745: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4745: error: syntax error before ')' token
    BerkeleyDB.c:7137: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7146: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:7149: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:7168: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr__txnbegin':
    BerkeleyDB.c:7183: error: syntax error before 'txnmgr'
    BerkeleyDB.xs:4768: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4768: error: syntax error before ')' token
    BerkeleyDB.c:7188: error: syntax error before 'RETVAL'
    code
    BerkeleyDB.c:6810: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6813: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6821: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_cdel':
    BerkeleyDB.c:6837: error: syntax error before 'db'
    BerkeleyDB.xs:4662: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4662: error: syntax error before ')' token
    BerkeleyDB.c:6841: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6850: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6853: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6864: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_cget':
    BerkeleyDB.c:6880: error: syntax error before 'db'
    BerkeleyDB.xs:4678: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4678: error: syntax error befBerkeleyDB.c:7198: error: 'txnmgr' undeclared (first use in this function)
    BerkeleyDB.c:7201: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.c:7207: error: 'pid' undeclared (first use in this function)
    BerkeleyDB.c:7213: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.xs:4771: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.xs:4772: error: 'p_id' undeclared (first use in this function)
    BerkeleyDB.xs:4790: error: 'RETVAL' undeclared (first use in this function)
    BerkeleyDB.xs:4790: error: syntax error before ')' token
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgrstatus':
    BerkeleyDB.c:7262: error: syntax error before 'mgr'
    BerkeleyDB.xs:4807: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4807: error: syntax error before ')' token
    BerkeleyDB.c:7266: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7269: error: 'mgr' undeclared (first use in this function)
    BerkeleyDB.c:7272: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.c:7280: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_DESTROY':
    BerkeleyDB.c:7294: error: syntax error before 'mgr'
    BerkeleyDB.xs:4818: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4818: error: syntax error before ')' token
    BerkeleyDB.c:7300: error: 'mgr' undeclared (first use in this function)
    BerkeleyDB.c:7303: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_txnclose':
    ore ')' token
    BerkeleyDB.c:6886: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6895: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6898: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6909: error: 'DBOPFLAGSMASK' undeclared (first use in this function)
    BerkeleyDB.c:6909: error: 'DBSETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:6912: error: 'dbrecnot' undeclared (first use in this function)
    BerkeleyDB.c:6922: error: 'DBGETBOTH' undeclared (first use in this function)
    BerkeleyDB.c:6929: error: 'DBT_B' has no member named 'flags'
    BerkeleyDB.c:6930: error: 'DBT_B' has no member named 'dlen'
    BerkeleyDB.c:6931: error: 'DBT_B' has no member named 'doff'
    BerkeleyDB.xs:4685: error: 'DBT_B' has no member named 'flags'
    BerkeleyDB.xs:4685: error: 'DBT_B' has no member named 'dlen'
    BerkeleyDB.xs:4685: error: 'DBT_B' has no member named 'doff'
    BerkeleyDB.c:6944: error: 'DBGETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:6946: error: 'DBJOINITEM' undeclared (first use in this function)
    BerkeleyDB.c:6949: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_cpget':
    BerkeleyDB.c:6965: error: syntax error before 'db'
    BerkeleyDB.xs:4701: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4701: error: syntax error before ')' token
    BerkeleyDB.c:6972: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:6981: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:6984: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:6995: error: 'DBOPFLAGSMASK' undeclared (first use in this function)
    BerkeleyDB.c:6995: error: 'DBSETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:6998: error: 'dbrecnot' undeclared (first use in this function)
    BerkeleyDB.c:7008: error: 'DBGETBOTH' undeclared (first use in this function)
    BerkeleyDB.c:7324: error: syntax error before 'txnp'
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_txncheckpoint':
    BerkeleyDB.c:7352: error: syntax error before 'txnp'
    BerkeleyDB.xs:4850: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4850: error: syntax error before ')' token
    BerkeleyDB.c:7359: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7362: error: 'txnp' undeclared (first use in this function)
    BerkeleyDB.c:7365: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.c:7378: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_txnstat':
    BerkeleyDB.c:7392: error: syntax error before 'txnp'
    BerkeleyDB.xs:4857: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4857: error: syntax error before ')' token
    BerkeleyDB.c:7399: error: 'txnp' undeclared (first use in this function)
    BerkeleyDB.c:7402: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.xs:4860: error: 'DBTXNSTAT' undeclared (first use in this function)
    BerkeleyDB.xs:4875: error: request for member 'sttimeckp' in something not a structure or union
    BerkeleyDB.xs:4876: error: request for member 'stlasttxnid' in something not a structure or union
    BerkeleyDB.xs:4877: error: request for member 'st_maxtxns' in something not a structure or union
    BerkeleyDB.xs:4878: error: request for member 'st_naborts' in something not a structure or union
    BerkeleyDB.xs:4879: error: request for member 'st_nbegins' in something not a structure or union
    BerkeleyDB.xs:4880: error: request for member 'st_ncommits' in something not a structure or union
    BerkeleyDB.xs:4881: error: request for member 'st_nactive' in something not a structure or union
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_txnopen':
    BerkeleyDB.c:7457: error: syntax error before 'dbenv'
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txnstatus':
    BerkeleyDB.c:7472: error: syntax error before 'tid'
    BerkeleyDB.xs:4910: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4910: error: syntax error before ')' token
    BerkeleyDB.c:7476: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7479: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7482: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7490: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_settimeout':
    BerkeleyDB.c:7504: error: syntax error before 'txn'
    BerkeleyDB.xs:4922: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4922: error: syntax error before ')' token
    BerkeleyDB.c:7510: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7514: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.c:7517: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_set_txmax':
    BerkeleyDB.c:7550: error: syntax error before 'txn'
    BerkeleyDB.c:7015: error: 'DBT_B' has no member named 'flags'
    BerkeleyDB.c:7016: error: 'DBT_B' has no member named 'dlen'
    BerkeleyDB.c:7017: error: 'DBT_B' has no member named 'doff'
    BerkeleyDB.c:7032: error: 'DBGETRECNO' undeclared (first use in this function)
    BerkeleyDB.c:7040: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs:4939: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4939: error: syntax error before ')' token
    BerkeleyDB.c:7555: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7559: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.c:7562: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_get_txmax':
    BerkeleyDB.c:7589: error: syntax error before 'txn'
    BerkeleyDB.xs:4956: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4956: error: syntax error before ')' token
    BerkeleyDB.c:7594: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7598: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.c:7601: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_DESTROY':
    BerkeleyDB.c:7631: error: syntax error before 'tid'
    BerkeleyDB.xs:4973: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4973: error: syntax error before ')' token
    BerkeleyDB.c:7637: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7640: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_txnunlink':
    BerkeleyDB.c:7671: error: syntax error before 'dbenv'
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_txnprepare':
    BerkeleyDB.c:7695: error: syntax error before 'tid'
    BerkeleyDB.xs:5007: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5007: error: syntax error before ')' token
    BerkeleyDB.c:7699: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_cput':
    BerkeleyDB.c:7056: error: syntax error before 'db'
    BerkeleyDB.xs:4730: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4730: error: syntax error before ')' token
    BerkeleyDB.c:7062: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7071: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:7074: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:7087: error: 'dbrecnot' undeclared (first use in this function)
    BerkeleyDB.c:7104: error: 'DBT' has no member named 'flags'
    BerkeleyDB.c:7105: error: 'DBT' has no member named 'dlen'
    BerkeleyDB.c:7106: error: 'DBT' has no member named 'doff'
    BerkeleyDB.c:7116: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Cursor_ccount':
    BerkeleyDB.c:7132: error: syntax error before 'db'
    BerkeleyDB.xs:4745: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4745: error: syntax error before ')' token
    BerkeleyDB.c:7137: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7146: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:7149: error: called object 'BerkeleyDB__Cursor' is not a function
    BerkeleyDB.c:7168: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr__txnbegin':
    BerkeleyDB.c:7183: error: syntax error before 'txnmgr'
    BerkeleyDB.xs:4768: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4768: error: syntax error before ')' token
    BerkeleyDB.c:7188: error: syntax error before 'RETVAL'
    BerkeleyDB.c:7198: error: 'txnmgr' undeclared (first use in this function)
    BerkeleyDB.c:7201: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.c:7207: error: 'pid' undeclared (first use in this function)
    BerkeleyDB.c:7213: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.xs:4771: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.xs:4772: error: 'p_id' undeclared (first use in this function)
    BerkeleyDB.xs:4790: error: 'RETVAL' undeclared (first use in this function)
    BerkeleyDB.xs:4790: error: syntax error before ')' token
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgrstatus':
    BerkeleyDB.c:7262: error: syntax error before 'mgr'
    BerkeleyDB.xs:4807: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4807: error: syntax error before ')' token
    BerkeleyDB.c:7266: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7269: error: 'mgr' undeclared (first use in this function)
    BerkeleyDB.c:7272: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.c:7280: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_DESTROY':
    BerkeleyDB.c:7294: error: syntax error before 'mgr'
    BerkeleyDB.xs:4818: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4818: error: syntax error before ')' token
    BerkeleyDB.c:7300: error: 'mgr' undeclared (first use in this function)
    BerkeleyDB.c:7303: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_txnclose':
    BerkeleyDB.c:7324: error: syntax error before 'txnp'
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_txncheckpoint':
    BerkeleyDB.c:7352: error: syntax error before 'txnp'
    BerkeleyDB.xs:4850: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4850: error: syntax error before ')' token
    BerkeleyDB.c:7359: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7362: error: 'txnp' undeclared (first use in this function)
    BerkeleyDB.c:7365: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.c:7378: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_txnstat':
    BerkeleyDB.c:7392: error: syntax error before 'txnp'
    BerkeleyDB.xs:4857: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4857: error: syntax error before ')' token
    BerkeleyDB.c:7399: error: 'txnp' undeclared (first use in this function)
    BerkeleyDB.c:7402: error: called object 'BerkeleyDB__TxnMgr' is not a function
    BerkeleyDB.xs:4860: error: 'DBTXNSTAT' undeclared (first use in this function)
    BerkeleyDB.xs:4875: error: request for member 'sttimeckp' in something not a structure or union
    BerkeleyDB.xs:4876: error: request for member 'stlasttxnid' in something not a structure or union
    BerkeleyDB.xs:4877: error: request for member 'st_maxtxns' in something not a structure or union
    BerkeleyDB.xs:4878: error: request for member 'st_naborts' in something not a structure or union
    BerkeleyDB.xs:4879: error: request for member 'st_nbegins' in something not a structure or union
    BerkeleyDB.xs:4880: error: request for member 'st_ncommits' in something not a structure or union
    BerkeleyDB.xs:4881: error: request for member 'st_nactive' in something not a structure or union
    BerkeleyDB.c: In function 'XSBerkeleyDB__TxnMgr_txnopen':
    BerkeleyDB.c:7457: error: syntax error before 'dbenv'
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txnstatus':
    BerkeleyDB.c:7472: error: syntax error before 'tid'
    BerkeleyDB.xs:4910: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4910: error: syntax error before ')' token
    BerkeleyDB.c:7476: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7479: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7482: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7490: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_settimeout':
    BerkeleyDB.c:7504: error: syntax error before 'txn'
    BerkeleyDB.xs:4922: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4922: error: syntax error before ')' token
    BerkeleyDB.c:7510: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7514: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.c:7517: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_set_txmax':
    BerkeleyDB.c:7550: error: syntax error before 'txn'
    BerkeleyDB.xs:4939: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4939: error: syntax error before ')' token
    BerkeleyDB.c:7555: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7559: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.c:7562: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_get_txmax':
    BerkeleyDB.c:7589: error: syntax error before 'txn'
    BerkeleyDB.xs:4956: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4956: error: syntax error before ')' token
    BerkeleyDB.c:7594: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7598: error: 'txn' undeclared (first use in this function)
    BerkeleyDB.c:7601: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_DESTROY':
    BerkeleyDB.c:7631: error: syntax error before 'tid'
    BerkeleyDB.xs:4973: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:4973: error: syntax error before ')' token
    BerkeleyDB.c:7637: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7640: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_txnunlink':
    BerkeleyDB.c:7671: error: syntax error before 'dbenv'
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_txnprepare':
    BerkeleyDB.c:7695: error: syntax error before 'tid'
    BerkeleyDB.xs:5007: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5007: error: syntax error before ')' token
    BerkeleyDB.c:7699: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7702: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7705: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7715: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn__txncommit':
    BerkeleyDB.c:7739: error: syntax error before 'tid'
    BerkeleyDB.xs:5025: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5025: error: syntax error before ')' token
    BerkeleyDB.c:7743: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7752: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7755: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7767: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn__txnabort':
    BerkeleyDB.c:7786: error: syntax error before 'tid'
    BerkeleyDB.xs:5040: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5040: error: syntax error before ')' token
    BerkeleyDB.c:7790: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7793: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7796: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7808: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn__txndiscard':
    BerkeleyDB.c:7831: error: syntax error before 'tid'
    BerkeleyDB.xs:5060: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5060: error: syntax error before ')' token
    BerkeleyDB.c:7836: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7839: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7842: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7860: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_txnid':
    BerkeleyDB.c:7879: error: syntax error before 'tid'
    BerkeleyDB.xs:5075: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5075: error: syntax error before ')' token
    BerkeleyDB.c:7883: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7887: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7890: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB___tiedHashFIRSTKEY':
    BerkeleyDB.c:7909: error: syntax error before 'db'
    BerkeleyDB.xs:5083: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5083: error: syntax error before ')' token
    BerkeleyDB.c:7913: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7917: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:7920: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.xs:5088: error: 'DBC' undeclared (first use in this function)
    BerkeleyDB.xs:5107: error: 'DB_FIRST' undeclared (first use in this function)
    BerkeleyDB.xs:5111: error: 'DB_NOTFOUND' undeclared (first use in this function)
    BerkeleyDB.c:7702: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7705: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7715: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn__txncommit':
    BerkeleyDB.c:7739: error: syntax error before 'tid'
    BerkeleyDB.xs:5025: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5025: error: syntax error before ')' token
    BerkeleyDB.c:7743: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7752: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7755: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7767: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn__txnabort':
    BerkeleyDB.c:7786: error: syntax error before 'tid'
    BerkeleyDB.xs:5040: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5040: error: syntax error before ')' token
    BerkeleyDB.c:7790: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7793: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7796: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7808: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn__txndiscard':
    BerkeleyDB.c:7831: error: syntax error before 'tid'
    BerkeleyDB.xs:5060: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5060: error: syntax error before ')' token
    BerkeleyDB.c:7836: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7839: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7842: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c:7860: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.c: In function 'XSBerkeleyDB__Txn_txnid':
    BerkeleyDB.c:7879: error: syntax error before 'tid'
    BerkeleyDB.xs:5075: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5075: error: syntax error before ')' token
    BerkeleyDB.c:7883: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7887: error: 'tid' undeclared (first use in this function)
    BerkeleyDB.c:7890: error: called object 'BerkeleyDB__Txn' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB___tiedHashFIRSTKEY':
    BerkeleyDB.c:7909: error: syntax error before 'db'
    BerkeleyDB.xs:5083: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5083: error: syntax error before ')' token
    BerkeleyDB.c:7913: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7917: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:7920: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.xs:5088: error: 'DBC' undeclared (first use in this function)
    BerkeleyDB.xs:5107: error: 'DB_FIRST' undeclared (first use in this function)
    BerkeleyDB.xs:5111: error: 'DB_NOTFOUND' undeclared (first use in this function)
    BerkeleyDB.c: In function 'XSBerkeleyDB___tiedHashNEXTKEY':
    BerkeleyDB.c:7971: error: syntax error before 'db'
    BerkeleyDB.xs:5126: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5126: error: syntax error before ')' token
    BerkeleyDB.c:7976: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7980: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:7983: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.xs:5134: error: 'DBTKEY' has no member named 'flags'
    BerkeleyDB.xs:5136: error: 'DB_NEXT' undeclared (first use in this function)
    BerkeleyDB.xs:5139: error: 'DB_NOTFOUND' undeclared (first use in this function)
    BerkeleyDB.c: In function 'XSBerkeleyDB___tiedArrayFETCHSIZE':
    BerkeleyDB.c:8019: error: syntax error before 'db'
    BerkeleyDB.xs:5153: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5153: error: syntax error before ')' token
    BerkeleyDB.c:8023: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8027: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:8030: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c: In function 'XSBerkeleyDB__Common_db_createsequence':
    BerkeleyDB.c:8051: error: syntax error before 'db'
    BerkeleyDB.xs:5168: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5168: error: syntax error before ')' token
    BerkeleyDB.c:8056: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8059: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:8062: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequenceopen':
    BerkeleyDB.xs:5199: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5199: error: syntax error before ')' token
    BerkeleyDB.c:8112: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8141: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequenceclose':
    BerkeleyDB.xs:5216: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5216: error: syntax error before ')' token
    BerkeleyDB.c:8160: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8192: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequenceremove':
    BerkeleyDB.xs:5238: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5238: error: syntax error before ')' token
    BerkeleyDB.c:8211: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8241: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__SequenceDESTROY':
    BerkeleyDB.xs:5257: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5257: error: syntax error before ')' token
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequenceget':
    BerkeleyDB.xs:5272: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5272: error: syntax error before ')' token
    BerkeleyDB.c:8294: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c: In function 'XSBerkeleyDB___tiedHashNEXTKEY':
    BerkeleyDB.c:7971: error: syntax error before 'db'
    BerkeleyDB.xs:5126: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5126: error: syntax error before ')' token
    BerkeleyDB.c:7976: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:7980: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:7983: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.xs:5134: error: 'DBTKEY' has no member named 'flags'
    BerkeleyDB.xs:5136: error: 'DB_NEXT' undeclared (first use in this function)
    BerkeleyDB.xs:5139: error: 'DB_NOTFOUND' undeclared (first use in this function)
    BerkeleyDB.c: In function 'XSBerkeleyDB___tiedArrayFETCHSIZE':
    BerkeleyDB.c:8019: error: syntax error before 'db'
    BerkeleyDB.xs:5153: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5153: error: syntax error before ')' token
    BerkeleyDB.c:8023: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8027: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:8030: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.c:8330: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_getkey':
    BerkeleyDB.xs:5290: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5290: error: syntax error before ')' token
    BerkeleyDB.c:8349: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8373: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_initialvalue':
    BerkeleyDB.xs:5310: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5310: error: syntax error before ')' token
    BerkeleyDB.c:8393: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8420: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_setcachesize':
    BerkeleyDB.xs:5327: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5327: error: syntax error before ')' token
    BerkeleyDB.c:8439: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8460: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_getcachesize':
    BerkeleyDB.xs:5344: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5344: error: syntax error before ')' token
    BerkeleyDB.c:8479: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8503: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_setflags':
    BerkeleyDB.xs:5362: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5362: error: syntax error before ')' token
    BerkeleyDB.c:8522: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8543: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_getflags':
    BerkeleyDB.xs:5379: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5379: error: syntax error before ')' token
    BerkeleyDB.c:8562: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8586: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'boot_BerkeleyDB':
    BerkeleyDB.xs:5414: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5414: error: syntax error before ')' token
    BerkeleyDB.xs:5417: error: 'DBVERSIONMAJOR' undeclared (first use in this function)
    BerkeleyDB.xs:5418: error: 'DBVERSIONMINOR' undeclared (first use in this function)
    BerkeleyDB.xs:5418: error: 'DBVERSIONPATCH' undeclared (first use in this function)
    BerkeleyDB.xs:5434: error: 'dbrecnot' undeclared (first use in this function)
    BerkeleyDB.c: In function 'XSBerkeleyDB__Common_db_createsequence':
    BerkeleyDB.c:8051: error: syntax error before 'db'
    BerkeleyDB.xs:5168: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5168: error: syntax error before ')' token
    BerkeleyDB.c:8056: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8059: error: 'db' undeclared (first use in this function)
    BerkeleyDB.c:8062: error: called object 'BerkeleyDB__Common' is not a function
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequenceopen':
    BerkeleyDB.xs:5199: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5199: error: syntax error before ')' token
    BerkeleyDB.c:8112: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8141: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequenceclose':
    BerkeleyDB.xs:5216: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5216: error: syntax error before ')' token
    BerkeleyDB.c:8160: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8192: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequenceremove':
    BerkeleyDB.xs:5238: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5238: error: syntax error before ')' token
    BerkeleyDB.c:8211: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8241: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__SequenceDESTROY':
    BerkeleyDB.xs:5257: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5257: error: syntax error before ')' token
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequenceget':
    BerkeleyDB.xs:5272: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5272: error: syntax error before ')' token
    BerkeleyDB.c:8294: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8330: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_getkey':
    BerkeleyDB.xs:5290: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5290: error: syntax error before ')' token
    BerkeleyDB.c:8349: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8373: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_initialvalue':
    BerkeleyDB.xs:5310: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5310: error: syntax error before ')' token
    BerkeleyDB.c:8393: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8420: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_setcachesize':
    BerkeleyDB.xs:5327: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5327: error: syntax error before ')' token
    BerkeleyDB.c:8439: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8460: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_getcachesize':
    BerkeleyDB.xs:5344: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5344: error: syntax error before ')' token
    BerkeleyDB.c:8479: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8503: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_setflags':
    BerkeleyDB.xs:5362: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5362: error: syntax error before ')' token
    BerkeleyDB.c:8522: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8543: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'XSBerkeleyDB__Sequence_getflags':
    BerkeleyDB.xs:5379: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5379: error: syntax error before ')' token
    BerkeleyDB.c:8562: warning: ISO C90 forbids mixed declarations and code
    BerkeleyDB.c:8586: warning: pointer/integer type mismatch in conditional expression
    BerkeleyDB.xs: In function 'boot_BerkeleyDB':
    BerkeleyDB.xs:5414: error: 'my_cxtp' undeclared (first use in this function)
    BerkeleyDB.xs:5414: error: syntax error before ')' token
    BerkeleyDB.xs:5417: error: 'DBVERSIONMAJOR' undeclared (first use in this function)
    BerkeleyDB.xs:5418: error: 'DBVERSIONMINOR' undeclared (first use in this function)
    BerkeleyDB.xs:5418: error: 'DBVERSIONPATCH' undeclared (first use in this function)
    BerkeleyDB.xs:5434: error: 'dbrecnot' undeclared (first use in this function)
    lipo: can't open input file: /var/tmp//ccGoTbzX.out (No such file or directory)
    make: * [BerkeleyDB.o] Error 1
    /usr/bin/make -- NOT OK
    Running make test
    Can't test without successful make
    Running make install
    make had returned bad status, install seems impossible
    I have found what might be the way to fix. Anyone has any idea?
    Inside the db-4.5.20/perl/BerkeleyDB/config.in file are these lines:
    # 1. Where is the file db.h?
    INCLUDE = /usr/local/BerkeleyDB/include
    # 2. Where is libdb?
    LIB = /usr/local/BerkeleyDB/lib
    They look pretty good... except for the fact that the BDB make installed
    everything under
    /usr/local/BerkeleyDB.4.5
    and no, it didn't bother with a symlink.
    Once I'd made that link
    /usr/local/BerkeleyDB -> /usr/local/BerkeleyDB.4.5
    the build ran very quickly and without errors.
    Cheers
    Ben

    Indeed, at this point if you don't know how to un-do what it is you have done,
    quite honestly your best bet is to do a full wipe & reinstall, and if you are going to use
    anyone's instructions (typically, tutorials), then make sure to fully read it from start to finish,
    and not install things that are not meant to be installed.
    If you know what you've done and why, with all due respect you should already be on your way to solving your conundrum(s), and not even needing to ask for any help here

  • Berkeley DB: Too Many Open Files

    I've installed BerkelyDB 6.0.3 on Mavericks but when I try to use it I get errors about there being too many open files:
    Apr-10-14 11:20:45 [Worker_10001] BerkeleyDB-CRT-ENV-ERROR (1) in HASH Delay , on file /Applications/assp/delaydb.bdb : BDB:Too many open files
    Apr-10-14 11:20:45 [Worker_10001] BerkeleyDB-ENV-ERROR Delay:  - BDB:Too many open files
    Apr-10-14 11:20:45 [Worker_10001] Delaydb database error: BerkeleyDB-ENV-ERROR Delay:  - BDB:Too many open files
    Does anyone know how to (permanently) increase these limits in Mavericks?
    Thanks,
    James.

    sudo sysctl -w kern.maxfiles=32768
    sudo sysctl -w kern.maxprocperuid=16384
    seemed to work.
    Created file /etc/sysctl.conf containing:
    kern.maxfiles=32768
    kern.maxprocperuid=16384
    so that the setting would survive a reboot.
    Hopefully that permanently fixes it.

  • Error while compiling BerkeleyDB: Command failed for target `util_sig.lo'

    Hi,
    While trying to compile BerkeleyDB on Solaris 10 x86 ( is there an easier way to get BerkeleyDB running than compiling from source? ) I was confronted with the error message appended.
    I used Berkeley 4.4.20 and configured by executing
    PATH=/usr/ccs/bin:${PATH} # for ar
    cd build_unix
    CC=gcc ../dist/configure
    Here the error message:
    UNIX /app/berkeleydb/db/4.4.20/build_unix
    $ make
    /usr/bin/sh ./libtool --mode=compile gcc -c -I. -I../dist/..  -D_REENTRANT -O2 ../common/util_sig.c
    gcc -c -I. -I../dist/.. -D_REENTRANT -O2 ../common/util_sig.c -fPIC -DPIC -o .libs/util_sig.o
    In file included from /usr/include/sys/signal.h:34,
    from /usr/include/signal.h:26,
    from ../common/util_sig.c:15:
    /usr/include/sys/siginfo.h:259: error: parse error before "ctid_t"
    /usr/include/sys/siginfo.h:292: error: parse error before '}' token
    /usr/include/sys/siginfo.h:294: error: parse error before '}' token
    /usr/include/sys/siginfo.h:390: error: parse error before "ctid_t"
    /usr/include/sys/siginfo.h:392: error: conflicting types for `__proc'
    /usr/include/sys/siginfo.h:261: error: previous declaration of `__proc'
    /usr/include/sys/siginfo.h:398: error: conflicting types for `__fault'
    /usr/include/sys/siginfo.h:267: error: previous declaration of `__fault'
    /usr/include/sys/siginfo.h:404: error: conflicting types for `__file'
    /usr/include/sys/siginfo.h:273: error: previous declaration of `__file'
    /usr/include/sys/siginfo.h:420: error: conflicting types for `__prof'
    /usr/include/sys/siginfo.h:287: error: previous declaration of `__prof'
    /usr/include/sys/siginfo.h:424: error: conflicting types for `__rctl'
    /usr/include/sys/siginfo.h:291: error: previous declaration of `__rctl'
    /usr/include/sys/siginfo.h:426: error: parse error before '}' token
    /usr/include/sys/siginfo.h:428: error: parse error before '}' token
    /usr/include/sys/siginfo.h:432: error: parse error before "k_siginfo_t"
    /usr/include/sys/siginfo.h:437: error: parse error before '}' token
    In file included from /usr/include/signal.h:26,
    from ../common/util_sig.c:15:
    /usr/include/sys/signal.h:85: error: parse error before "siginfo_t"
    In file included from ../common/util_sig.c:15:
    /usr/include/signal.h:111: error: parse error before "siginfo_t"
    /usr/include/signal.h:113: error: parse error before "siginfo_t"
    *** Error code 1
    make: Fatal error: Command failed for target `util_sig.lo'
    Thanks, Dietrich
    PS:
    I need the LDAP server for playing with a JAAS LDAP login module and something minimal would be enough. Is there something easier to install than OpenLDAP?

    I fail to understand why you're taking all this trouble. Both the Berkeley DB as OpenLDAP are both shipped with Solaris 10/x86 natively. Look into the so called companion cd / dvd. That makes setting all of this up a piece of cake.
    Another option could be looking into Blastwave or Sun Freeware.

  • 10.5.8 Server, Amavisd 2.6.4 crahing perl, with BerkeleyDB Problem

    By searching the interwebs and discussions here didn't find a solution that worked for me yet.
    System Details: Quad intel Xserve, 10.5.8 Server (Security Update 2009-005 not yet applied.)
    Seems to have started this night around 2am.
    Amavisd-new 2.6.4 will not accept transport anymore. Logs the well known
    Sep 16 15:23:00 mail postfix/qmgr[3853]: warning: connect to transport smtp-amavis: Connection refused
    Sep 16 15:23:12 mail deliver[3869]: connect(/var/imap/socket/lmtp) failed: Connection refused
    messages to the log.
    Tried rebuilding amasid-new and all the needed perl modules. CPAN worked well, yet perl seems to crash anytime amavisd will access a BerkelyDB from cyrus.
    SMTP in seems to work fine, SMTP out as well, transport from postfix to cyrus via amavisd is still broken. My own user account can send and even receive mails without a problem, which stumps me a little. I only have that user for testing purposes, so it doesn't carry any amount of email beyond test mails, counting less than 100 messages.
    I have already checked for privileges and quota problems with the .db.
    Repairing the Database with ServerAdmin hasn't helped, as did a reconstruct with ServerAdmin. I'm still trying to avoid full mailbox rebuilds. I'd prefer rebuilding only the problematic mailboxes and not all mailboxes to have a few as possible users with all their unread status reset.
    For a quick fix, I'd like to be able to deliver mails to the users boxes so they get their mails for the moment, seems they are able to send without problems. This should buy me a little more time until I can fix it all properly.
    Turning off Spam and Virus filtering doesn't help the delivery, which I expected it would. doesn't this time.
    How can I find out which user's mailboxes are corrupted so I can only completely rebuild the ones really needed? I'm willing to jump through substantial hoops to prevent the need to do a full server mailbox rebuild. (ca. 90GB of mails in total… would take a looong time and upset the users.)
    I can test everything and can of course provide any more details you might need to help me.
    This setup is quite modified from Apple's stock setup mostly following pterobyte's excellent recommendations and tutorials for improvement.
    Best regards
    Pepi
    This is what the mail system logs when starting up:
    Clearly there is a problem with the cyrus databases which seem to cause amavisd/perl to crash.
    Sep 16 15:43:29 mail sudo[68375]: radmin : TTY=ttys007 ; PWD=/private/var ; USER=root ; COMMAND=/usr/sbin/serveradmin start mail
    Sep 16 15:43:30 mail master[68377]: process started
    Sep 16 15:43:30 mail postfix/postfix-script[68382]: fatal: the Postfix mail system is not running
    Sep 16 15:43:30 mail ctl_cyrusdb[68379]: DBERROR db4: DBENV->logflush: LSN of 1/62288 past current end-of-log of 1/15979
    Sep 16 15:43:30 mail ctl_cyrusdb[68379]: DBERROR db4: Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment
    Sep 16 15:43:30 mail ctl_cyrusdb[68379]: DBERROR db4: /var/imap/tls_sessions.db: unable to flush page: 0
    Sep 16 15:43:30 mail ctl_cyrusdb[68379]: DBERROR db4: txn_checkpoint: failed to flush the buffer cache Invalid argument
    Sep 16 15:43:30 mail ctl_cyrusdb[68379]: DBERROR db4: PANIC: Invalid argument
    Sep 16 15:43:30 mail ctl_cyrusdb[68379]: DBERROR: critical database situation
    Sep 16 15:43:35 mail master[68377]: process 68379 exited, status 75
    Sep 16 15:43:35 mail idled[68430]: cleaning up corrupted database files in: /var/imap/db
    Sep 16 15:43:35 mail idled[68430]: ----: removed file: __db.001
    Sep 16 15:43:35 mail idled[68430]: ----: removed file: __db.002
    Sep 16 15:43:35 mail idled[68430]: ----: removed file: __db.003
    Sep 16 15:43:35 mail idled[68430]: ----: removed file: __db.004
    Sep 16 15:43:35 mail idled[68430]: ----: removed file: __db.005
    Sep 16 15:43:35 mail idled[68430]: ----: removed file: log.0000000001
    Sep 16 15:43:36 mail master[68377]: Cyrus POP/IMAP Server v2.3.8 ready for work
    Sep 16 15:43:36 mail ctl_cyrusdb[68432]: checkpointing cyrus databases
    Sep 16 15:43:36 mail ctl_cyrusdb[68432]: done checkpointing cyrus databases
    Sep 16 15:44:01 mail sudo[68459]: root : TTY=unknown ; PWD=/ ; USER=_cyrus ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r
    This is what is written to the crash report:
    $ cat perl2009-09-16-145012Buzz-Lightyear.crash
    Process: perl [2230]
    Path: /usr/bin/perl
    Identifier: perl
    Version: ??? (???)
    Code Type: X86 (Native)
    Parent Process: launchd [1]
    Date/Time: 2009-09-16 14:50:12.683 +0200
    OS Version: Mac OS X Server 10.5.8 (9L34)
    Report Version: 6
    Anonymous UUID: 351B0AD5-FE9F-4556-A043-7FE8E4595D06
    Exception Type: EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000
    Crashed Thread: 0
    Dyld Error Message:
    Symbol not found: dbversion
    Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/BerkeleyDB/BerkeleyDB.bundl e
    Expected in: dynamic lookup
    I don't expect it to be of help in this case, but here is my postconf for completeness.
    $ postconf -n
    always_bcc = [email protected]
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    content_filter =
    daemon_directory = /usr/libexec/postfix
    debugpeerlevel = 2
    enableserveroptions = yes
    html_directory = no
    inet_interfaces = all
    localrecipientmaps = proxy:unix:passwd.byname $alias_maps
    mail_owner = _postfix
    mailboxsizelimit = 0
    mailbox_transport = cyrus
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    mapsrbldomains =
    messagesizelimit = 20971520
    mydomain = mail.raiffeisenzeitung.at
    mydomain_fallback = localhost
    myhostname = mail.raiffeisenzeitung.at
    mynetworks = 127.0.0.1/32
    newaliases_path = /usr/bin/newaliases
    queue_directory = /private/var/spool/postfix
    readme_directory = /usr/share/doc/postfix
    relayhost =
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = _postdrop
    smtpdclientrestrictions = permit_mynetworks rejectrblclient zen.spamhaus.org rejectrblclient ix.dnsbl.manitu.net permit
    smtpdenforcetls = no
    smtpdpw_server_securityoptions = gssapi,cram-md5
    smtpdrecipientrestrictions = permitsasl_authenticated,permit_mynetworks,hash:/etc/postfix/rejects,reject_unauth_des tination,reject_unlistedrecipient,permit
    smtpdsasl_authenable = yes
    smtpdtls_certfile = /etc/certificates/mail.raiffeisenzeitung.at.crt
    smtpdtls_keyfile = /etc/certificates/mail.raiffeisenzeitung.at.key
    smtpduse_pwserver = yes
    smtpdusetls = yes
    tlsrandomsource = dev:/dev/urandom
    unknownlocal_recipient_rejectcode = 550
    virtualaliasdomains = hash:/etc/postfix/virtual_domains
    virtualaliasmaps = hash:/etc/postfix/virtual
    virtualmailboxdomains = hash:/etc/postfix/virtualdomainsdummy
    virtual_transport = lmtp:unix:/var/imap/socket/lmtp

    Hi Alex,
    thanks for chiming in!
    I'm quite confident, that nobody installed BerkeleyDB at 2am on that server. Neither on purpose nor accidentally.
    Just for the record… the usual suspects have be checked as well:
    I've checked the filesystem, and it seems to be ok.
    I've repaired privileges, and they seem to be ok.
    I've used mailbfr to rebuild each and every mailbox. (-m)
    I've used mailbfr to repair mail system privs and quota. (-o, -q)
    The system has plenty of freespace on all drives.
    Additional info about the current behavior:
    I've turned off virus and spam filtering for the moment. Mails can be sent and do get delivered for all the accounts I've tested. The ones that are already in the queue do not get delivered. I've even tried to manually flush the queue, though postfix usually never needs that and know best when to do what. Anyway it didn't convince postfix to deliver the queued mails.
    From the logs I can see that cyrus complains about a critical database condition in
    Sep 16 20:49:41 mail ctl_cyrusdb[39320]: DBERROR db4: Log sequence error: page LSN 1 3679; previous LSN 10 7846960
    Sep 16 20:49:41 mail ctl_cyrusdb[39320]: DBERROR db4: Recovery function for LSN 1 3308 failed on forward pass
    Sep 16 20:49:41 mail ctl_cyrusdb[39320]: DBERROR db4: PANIC: Invalid argument
    Sep 16 20:49:41 mail ctl_cyrusdb[39320]: DBERROR: critical database situation
    Sep 16 20:49:47 mail idled[39372]: cleaning up corrupted database files in: /var/imap/db
    These problems persist after a server restart.
    Log Details when I try to activate Spam or virus filtering again:
    Sep 16 21:19:30 mail org.amavis.amavisd[1278]: Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/BerkeleyDB/BerkeleyDB.bundl e
    Sep 16 21:19:30 mail org.amavis.amavisd[1278]: Expected in: dynamic lookup
    Sep 16 21:19:31 mail ReportCrash[1292]: Formulating crash report for process perl[1278]
    Sep 16 21:19:31 mail ReportCrash[1292]: Saved crashreport to /Library/Logs/CrashReporter/perl2009-09-16-211931Buzz-Lightyear.crash using uid: 0 gid: 0, euid: 0 egid: 0
    Sep 16 21:19:31 mail com.apple.launchd[1] (org.amavis.amavisd[1278]): Exited abnormally: Trace/BPT trap
    Sep 16 21:19:31 mail org.amavis.amavisd[1294]: dyld: lazy symbol binding failed: Symbol not found: dbversion
    Sep 16 21:19:31 mail org.amavis.amavisd[1294]: Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/BerkeleyDB/BerkeleyDB.bundl e
    Sep 16 21:19:31 mail org.amavis.amavisd[1294]: Expected in: dynamic lookup
    Sep 16 21:19:31 mail org.amavis.amavisd[1294]: dyld: Symbol not found: dbversion
    Sep 16 21:19:31 mail org.amavis.amavisd[1294]: Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/BerkeleyDB/BerkeleyDB.bundl e
    Sep 16 21:19:31 mail org.amavis.amavisd[1294]: Expected in: dynamic lookup
    Sep 16 21:19:31 mail ReportCrash[1292]: Formulating crash report for process perl[1294]
    Sep 16 21:19:31 mail ReportCrash[1292]: Saved crashreport to /Library/Logs/CrashReporter/perl2009-09-16-211931Buzz-Lightyear.crash using uid: 0 gid: 0, euid: 0 egid: 0
    Sep 16 21:19:31 mail com.apple.launchd[1] (org.amavis.amavisd[1294]): Exited abnormally: Trace/BPT trap
    Sep 16 21:19:31 mail com.apple.launchd[1] (org.amavis.amavisd): Throttling respawn: Will start in 10 seconds
    Sep 16 21:19:34 mail org.clamav.clamd[1204]: Pid file removed.
    Sep 16 21:19:34 mail org.clamav.clamd[1204]: --- Stopped at Wed Sep 16 21:19:34 2009
    Sep 16 21:19:34 mail org.clamav.clamd[1204]: Socket file removed.
    I've already rebuilt amavisd-new 2.6.4 and ClamAV 0.95.2 (with your extras) then rebootet. As expected, the cyrus problems remain. Perl is still crashing as soon as amavisd or ClamAV shall start. Mail delivery directly to cyrus without filtering seems to work fine at the moment. Queued mails stay where they are and do not get delivered.
    Log and status output:
    This is what CPAN tells me about the installed Perl BerkeleyDB Module:
    CPAN: Storable loaded ok (v2.15)
    Going to read '/Users/radmin/.cpan/Metadata'
    Database was generated on Wed, 16 Sep 2009 07:31:39 GMT
    Module id = BerkeleyDB
    DESCRIPTION Interface to Berkeley DB version 2, 3 or 4
    CPAN_USERID PMQS (Paul Marquess <[email protected]>)
    CPAN_VERSION 0.39
    CPAN_FILE P/PM/PMQS/BerkeleyDB-0.39.tar.gz
    UPLOAD_DATE 2009-06-06
    DSLIP_STATUS RdcOp (released,developer,C,object-oriented,Standard-Perl)
    MANPAGE BerkeleyDB - Perl extension for Berkeley DB version 2, 3 or 4
    INST_FILE /Library/Perl/5.8.8/darwin-thread-multi-2level/BerkeleyDB.pm
    INST_VERSION 0.39
    This happens when I start the mail system with spam and virus filtering turned off:
    Sep 16 20:49:37 mail com.apple.launchd[1] (org.postfix.master[35692]): Exited: Terminated
    Sep 16 20:49:37 mail postfix/postfix-script[39262]: fatal: the Postfix mail system is not running
    Sep 16 20:49:40 mail net.clamav.clamd[35631]: Pid file removed.
    Sep 16 20:49:40 mail net.clamav.clamd[35631]: --- Stopped at Wed Sep 16 20:49:40 2009
    Sep 16 20:49:40 mail net.clamav.clamd[35631]: Socket file removed.
    Sep 16 20:49:40 mail com.apple.launchd[1] (edu.cmu.andrew.cyrus.master[35710]): Stray process with PGID equal to this dead job: PID 38979 PPID 1 imapd
    Sep 16 20:49:41 mail master[39317]: process started
    Sep 16 20:49:41 mail postfix/postfix-script[39322]: fatal: the Postfix mail system is not running
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Limits: Global size limit set to 20971520 bytes.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Limits: File size limit set to 15728640 bytes.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Limits: Recursion level limit set to 10.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Limits: Files limit set to 1500.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Archive support enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Algorithmic detection enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Portable Executable support enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: ELF support enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Detection of broken executables enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Mail files support enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: OLE2 support enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: PDF support enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: HTML support enabled.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Self checking every 600 seconds.
    Sep 16 20:49:41 mail net.clamav.clamd[39308]: Set stacksize to 1048576
    Sep 16 20:49:41 mail ctl_cyrusdb[39320]: DBERROR db4: Log sequence error: page LSN 1 3679; previous LSN 10 7846960
    Sep 16 20:49:41 mail ctl_cyrusdb[39320]: DBERROR db4: Recovery function for LSN 1 3308 failed on forward pass
    Sep 16 20:49:41 mail ctl_cyrusdb[39320]: DBERROR db4: PANIC: Invalid argument
    Sep 16 20:49:41 mail ctl_cyrusdb[39320]: DBERROR: critical database situation
    Sep 16 20:49:47 mail master[39317]: process 39320 exited, status 75
    Sep 16 20:49:47 mail idled[39372]: cleaning up corrupted database files in: /var/imap/db
    Sep 16 20:49:47 mail idled[39372]: ----: removed file: __db.001
    Sep 16 20:49:47 mail idled[39372]: ----: removed file: __db.002
    Sep 16 20:49:47 mail idled[39372]: ----: removed file: __db.003
    Sep 16 20:49:47 mail idled[39372]: ----: removed file: __db.004
    Sep 16 20:49:47 mail idled[39372]: ----: removed file: __db.005
    Sep 16 20:49:47 mail idled[39372]: ----: removed file: log.0000000001
    Sep 16 20:49:47 mail master[39317]: Cyrus POP/IMAP Server v2.3.8 ready for work
    Sep 16 20:49:47 mail ctl_cyrusdb[39374]: checkpointing cyrus databases
    Sep 16 20:49:47 mail ctl_cyrusdb[39374]: done checkpointing cyrus databases
    Should I try to use mailbfr -f (and get about 900.000 unread mails)? If there is nothing else I can do to fix this, I'll do it. It takes what it takes.
    Thanks
    Best regards
    Pepi

  • Error while running  BDB tcl testsuite commands

    Hi,
    I build berkeley db (4.7.25) libraries with tcl test suite is enabled in the solaris 9 machine using below configuration
    ../dist/configure --enable-dynamic ${BUILD_TAG} enable-tcl with-tcl=/export/tcl8.5/lib enable-test enable-java -prefix ${BUILD_DIR}
    I used tcl 8.5, jdk1.6.0_18 and gcc-3.4.6 for building libraries.Libraries are build successfully.
    When I run tcl command "run_std" in the tcl prompt, test is completed with below error logs in ALL.OUT file.
    ==========================================================================
    cat ALL.OUT | grep FAIL
    FAIL: error message in .out file: ./TESTDIR/lock003.1.out:FAIL:14:53:06 (00:00:01) number of other locks on 5: expected 0, got 1
    FAIL: error message in .out file: ./TESTDIR/lock003.1.out:FAIL:14:53:06 (00:00:00) ../dist/../test/lockscript.tcl run: FAIL:14:53:06 (00:00:01) number of other locks on 5: expected 0, got 1: pid 28332: expected 0, got 1
    FAIL: error message in .out file: ./TESTDIR/lock003.1.out:FAIL:18:24:50 (00:00:00) number of other locks on 44: expected 0, got 1
    FAIL: error message in .out file: ./TESTDIR/lock003.1.out:FAIL:18:24:50 (00:00:00) ../dist/../test/lockscript.tcl run: FAIL:18:24:50 (00:00:00) number of other locks on 44: expected 0, got 1: pid 28378: expected 0, got 1
    FAIL:03:09:45 (00:00:42) db_dump/db_load(./TESTDIR/primary007.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:09:45 (00:00:00) Dump/load of ./TESTDIR/primary007.db failed.
    FAIL:03:09:45 (00:00:00) db_dump/db_load(./TESTDIR/secondary007.0.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:09:45 (00:00:00) Dump/load of ./TESTDIR/secondary007.0.db failed.
    FAIL:03:09:45 (00:00:00) db_dump/db_load(./TESTDIR/secondary007.1.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:09:45 (00:00:00) Dump/load of ./TESTDIR/secondary007.1.db failed.
    FAIL:03:10:31 (00:00:46) db_dump/db_load(./TESTDIR/primary008.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:10:31 (00:00:00) Dump/load of ./TESTDIR/primary008.db failed.
    FAIL:03:10:31 (00:00:00) db_dump/db_load(./TESTDIR/secondary008.0.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:10:31 (00:00:00) Dump/load of ./TESTDIR/secondary008.0.db failed.
    FAIL:03:10:31 (00:00:00) db_dump/db_load(./TESTDIR/secondary008.1.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:10:31 (00:00:00) Dump/load of ./TESTDIR/secondary008.1.db failed.
    FAIL:03:12:06 (00:01:35) db_dump/db_load(./TESTDIR/primary001.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:06 (00:00:00) Dump/load of ./TESTDIR/primary001.db failed.
    FAIL:03:12:06 (00:00:00) db_dump/db_load(./TESTDIR/secondary001.0.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:06 (00:00:00) Dump/load of ./TESTDIR/secondary001.0.db failed.
    FAIL:03:12:06 (00:00:00) db_dump/db_load(./TESTDIR/secondary001.1.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:06 (00:00:00) Dump/load of ./TESTDIR/secondary001.1.db failed.
    FAIL:03:12:34 (00:00:28) db_dump/db_load(./TESTDIR/primary002.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:34 (00:00:00) Dump/load of ./TESTDIR/primary002.db failed.
    FAIL:03:12:34 (00:00:00) db_dump/db_load(./TESTDIR/secondary002.0.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:34 (00:00:00) Dump/load of ./TESTDIR/secondary002.0.db failed.
    FAIL:03:12:34 (00:00:00) db_dump/db_load(./TESTDIR/secondary002.1.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:34 (00:00:00) Dump/load of ./TESTDIR/secondary002.1.db failed.
    FAIL:03:12:47 (00:00:00) db_dump/db_load(./TESTDIR/primary006.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:47 (00:00:00) Dump/load of ./TESTDIR/primary006.db failed.
    FAIL:03:12:47 (00:00:00) db_dump/db_load(./TESTDIR/secondary006.1.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:47 (00:00:00) Dump/load of ./TESTDIR/secondary006.1.db failed.
    FAIL:03:12:47 (00:00:00) db_dump/db_load(./TESTDIR/secondary006.2.db:couldn't create pipe: too many open files): expected 0, got 1
    FAIL:03:12:47 (00:00:00) Dump/load of ./TESTDIR/secondary006.2.db failed.
    FAIL:03:13:10 (00:00:23) r: sindex: db open:too many open files
    FAIL:06:38:47 (02:19:40) rep_process_message returned DB_NOTFOUND: No matching key/data pair found
    ====================================================================================
    What could be the reason for the above errors while running the tcl testsuite ?
    Is there any problem in berkeley db libraries that are build with above configuration?
    Could you please clarify.
    Thanks in advance.
    Regards,
    Madhu

    Hi Sandra,
    I have executed lock003 in the tclsh prompt and error occurred while executing this lock test.
    ========================================================
    [exec] Lock003: Multi-process random lock test
    [exec] Lock003.a: Create environment
    [exec] Script watcher process 11571 launching lockscript.tcl process 11574.
    [exec] Script watcher process 11570 launching lockscript.tcl process 11573.
    [exec] Script watcher process 11572 launching lockscript.tcl process 11575.
    [exec] Script watcher process 11576 launching lockscript.tcl process 11578.
    [exec] Lock003.b: 5 independent processes now running
    [exec] Script watcher process 11577 launching lockscript.tcl process 11597.
    [exec] 06:35:39 (00:00:00) processes running: 11570 11571 11574 11572 11573 11575 11576 11578 11577 11597
    [exec] 06:36:15 (00:00:36) processes running: 11570 11571 11574 11572 11573 11575 11576 11578 11577 11597
    [exec] 06:36:51 (00:00:36) processes running: 11570 11571 11574 11572 11573 11575 11576 11578 11577 11597
    [exec] 06:37:27 (00:00:36) processes running: 11570 11571 11574 11572 11573 11575 11576 11578 11577 11597
    [exec] 06:38:03 (00:00:36) processes running: 11570 11571 11574 11572 11573 11575 11576 11578 11577 11597
    [exec] 06:38:38 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 06:39:12 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 06:39:48 (00:00:36) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 06:40:22 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 06:40:57 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 06:41:32 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 06:42:07 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 06:42:41 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:48:46 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:49:20 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:49:55 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:50:29 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:51:04 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:51:39 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:52:13 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:52:48 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:53:23 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:53:58 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:54:32 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:55:07 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:55:41 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:56:16 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:56:51 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:57:25 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:58:00 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:58:34 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:59:09 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 09:59:46 (00:00:37) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 10:00:21 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 10:00:56 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 10:01:30 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 10:02:05 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 10:02:39 (00:00:34) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] 10:03:14 (00:00:35) processes running: 11571 11574 11572 11575 11576 11578 11577 11597
    [exec] All processes have exited.
    [exec] FAIL: error message in .out file: ./TESTDIR/lock003.0.out:FAIL:06:38:00 (00:00:00) number of other locks on 52: expected 0, got 1
    [exec] FAIL: error message in .out file: ./TESTDIR/lock003.0.out:FAIL:06:38:00 (00:00:00) ../dist/../test/lockscript.tcl run: FAIL:06:38:00 (00:00:00) number of other locks on 52: expected 0, got 1: pid 11573: expected 0, got 1
    ===================================================================
    Is this problem occur if berkeley db jars having any issues ?Why because, when berkeleydb jars (build without tcl test flags in the same environment) are used in application under high load,application is hanged because of berkeley db native api.
    Sorry,I could not change ulimit value in my system because of lack of permissions.
    Can you please explain what could be the reason for the above error and how to rectify it.
    Thanks
    Madhu

  • Problem when simultaneously retriving data from berkeleydb using web applic

    Hi all
    Plz Help
    i am using jboss server .
    my problem is :
    i have 2lacks recodrs in berkeleydatabase
    when i try to retrive data it working properly for one browser
    if i start retrive data simultaneously using two IES it getting this exception
    how to solve this problem,i mean separeate session for separate client
    in java session trking techique i applied ,but here not working retriving data from berkeleydb.collision occur
    11:47:08,468 ERROR [STDERR] Database handles still open at environment close
    11:47:08,468 ERROR [STDERR] Open database handle: smscsucc.db
    11:47:08,468 ERROR [STDERR] java.lang.IllegalArgumentException: Invalid argument
    11:47:08,468 ERROR [STDERR] at com.sleepycat.db.internal.db_javaJNI.DbEnv_cl
    ose0(Native Method)
    11:47:08,468 ERROR [STDERR] at com.sleepycat.db.internal.DbEnv.close0(DbEnv.
    java:208)
    11:47:08,468 ERROR [STDERR] at com.sleepycat.db.internal.DbEnv.close(DbEnv.j
    ava:76)
    11:47:08,468 ERROR [STDERR] at com.sleepycat.db.Environment.close(Environmen
    t.java:39)
    11:47:08,468 ERROR [STDERR] at daos.RetriveDao.getData(RetriveDao.java:131)
    11:47:08,468 ERROR [STDERR] at controllers.MainServlet.getData(MainServlet.j
    ava:47)
    11:47:08,468 ERROR [STDERR] at controllers.MainServlet.serviceHelper(MainSer
    vlet.java:76)
    11:47:08,468 ERROR [STDERR] at controllers.MainServlet.doGet(MainServlet.jav
    a:101)
    11:47:08,468 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe
    rvlet.java:697)
    11:47:08,468 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe
    rvlet.java:810)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
    in.internalDoFilter(ApplicationFilterChain.java:252)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
    in.doFilter(ApplicationFilterChain.java:173)
    11:47:08,468 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilte
    r.doFilter(ReplyHeaderFilter.java:96)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
    in.internalDoFilter(ApplicationFilterChain.java:202)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
    in.doFilter(ApplicationFilterChain.java:173)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve
    .invoke(StandardWrapperValve.java:213)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve
    .invoke(StandardContextValve.java:178)
    11:47:08,468 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssocia
    tionValve.invoke(SecurityAssociationValve.java:175)
    11:47:08,468 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValv
    e.invoke(JaccContextValve.java:74)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.in
    voke(StandardHostValve.java:126)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.i
    nvoke(ErrorReportValve.java:105)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.
    invoke(StandardEngineValve.java:107)
    11:47:08,468 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.s
    ervice(CoyoteAdapter.java:148)
    11:47:08,468 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.proc
    ess(Http11Processor.java:869)
    11:47:08,468 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$H
    ttp11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    11:47:08,468 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.pr
    ocessSocket(PoolTcpEndpoint.java:527)
    11:47:08,468 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerT
    hread.run(MasterSlaveWorkerThread.java:112)
    11:47:08,468 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x29693a05, pid=832, tid=3776
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
    # Problematic frame:
    # C [libdb44.dll+0x33a05]
    # An error report file with more information is saved as hs_err_pid832.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    Press any key to continue . . .
    Thnking you
    Thanks & Regards
    Venkat Gadarla

    Hello,
    Your question is about Berkeley DB -- this is the Berkeley DB Java Edition forum. Please repost this over at:
    Berkeley DB
    Thanks.
    Charles Lamb

  • SA: BerkeleyDB not available...

    Hello everybody,
    is there an explanation, why amavis is giving me this error on a standard mail installation of OS X Server 10.4.3 -> 10.4.4?
    (You only see the error if you chance the protocol level to debug.)
    "BerkeleyDB not available, using memory-based local cache"
    Thanks for your help!
    Oliver
      Mac OS X (10.4.4)  

    Unfortunately, you thought you were doing the right thing to purchase storage, but the purchase does not help at all.
    Your iPhone has however much storage it came with when you purchased it.  That number cannot change.
    What you purchased was additional storage space for iCloud backups.  This will not help you at all.
    To clear space on your iPhone, go to Settings > General > Usage.  This will display your storage hogs.  Reduce some of them.

  • Bug report & possible patch: Wrong memory allocation when using BerkeleyDB in concurrent processes

    When using the BerkeleyDB shared environment in parallel processes, the processes get "out of memory" error, even when there is plenty of free memory available. This results in possible database corruption.
    Typical use case when this bug manifests is when BerkeleyDB is used by rpm, which is installing an rpm package into custom location, or calls another rpm instance during the installation process.
    The bug seems to originate in the env/env_region.c file: (version of the file from BDB 4.7.25, although the culprit code is the same in newer versions too):
    330     /*
    331      * Allocate room for REGION structures plus overhead.
    332      *
    333      * XXX
    334      * Overhead is so high because encryption passwds, replication vote
    335      * arrays and the thread control block table are all stored in the
    336      * base environment region.  This is a bug, at the least replication
    337      * should have its own region.
    338      *
    339      * Allocate space for thread info blocks.  Max is only advisory,
    340      * so we allocate 25% more.
    341      */
    342     memset(&tregion, 0, sizeof(tregion));
    343     nregions = __memp_max_regions(env) + 10;
    344     size = nregions * sizeof(REGION);
    345     size += dbenv->passwd_len;
    346     size += (dbenv->thr_max + dbenv->thr_max / 4) *
    347         __env_alloc_size(sizeof(DB_THREAD_INFO));
    348     size += env->thr_nbucket * __env_alloc_size(sizeof(DB_HASHTAB));
    349     size += 16 * 1024;
    350     tregion.size = size;
    Usage from the rpm's perspective:
    The line 346 calculates how much memory we need for structures DB_THREAD_INFO. We allocate structure DB_THREAD_INFO for every process calling db4 library. We don't deallocate these structures but when number of processes is greater than dbenv->thr_max then we try to reuse some structure for process that is already dead (or doesn't use db4 no longer). But we have DB_THREAD_INFOs in hash buckets and we can reuse DB_THREAD_INFO only if it is in the same hash bucket as new DB_TREAD_INFO. So line 346 should contain:
    346     size += env->thr_nbucket * (dbenv->thr_max + dbenv->thr_max / 4) *
    347         __env_alloc_size(sizeof(DB_THREAD_INFO));
    Why we don't encounter this problem earlier? There are some magic reserves as you can see on line 349 and some other additional space is created by alligning to blocks. But if we have two processes running at the same time and these processes end up in the same hash bucket and we repeat this proces many times to fill all hash buckets with two DB_THREAD_INFOs then we have 2 * env->thr_nbucket(37) = 74 DB_THREAD_INFOs, which is much more than dbenv->thr_max(8) + dbenv->thr_max(8) / 4 = 10 and plus allocation from dbc_put, we are out of memory.
    And how we will create two processes that end up in the same hash bucket. We can start one process (rpm -i) and then in scriptlet we start many processes (rpm -q ...) in loop and one of them will be in the same hash bucket as the first process (rpm -i).
    I would like to know your opinion on this issue, and if the proposed fix would be acceptable.
    Thanks in advance for answers.

    The attached patch for db-4.7 makes two changes:
      it allows enough for each bucket to have the configured number of threads, and
      it initializes env->thr_nbuckets, which previously had not been initialized.
    Please let us know how it works for you.
    Regards,
    Charles

  • Error Building DBXML-2.5.16 in Solaris 10 (SPARC)

    Hi all,
    I'm trying to build dbxml-2.4.16 from source in my Solaris 10 machine. Compilation starts well and goes on, but Berkeley-DB build fails with the following error
    make: *** [libdb-4.6.la] Error 1
    Here is my setup details.
    bash-3.00# uname -a
    SunOS WBTURGO02 5.10 Generic_137137-09 sun4v sparc SUNW,Netra-T5220
    bash-3.00# gcc -v
    Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
    Configured with: ../configure with-as=/usr/ccs/bin/as with-ld=/usr/ccs/bin/ld enable-shared enable-languages=c,c++,f77
    Thread model: posix
    gcc version 3.4.6
    bash-3.00# g++ -v
    Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
    Configured with: ../configure with-as=/usr/ccs/bin/as with-ld=/usr/ccs/bin/ld enable-shared enable-languages=c,c++,f77
    Thread model: posix
    gcc version 3.4.6
    bash-3.00# make -v
    GNU Make 3.82
    Built for sparc-sun-solaris2.10
    Copyright (C) 2010 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    And, the command that I used to trigger the build is
    bash-3.00# cd /export/home/kaja/BDB/dbxml-2.4.16
    bash-3.00# ./buildall.sh -p solaris -c gcc -x g++ -m make prefix=/export/home/kaja/BDB/Install-2.4.16 enable-java with-dbxml=/export/home/kaja/BDB/dbxml-2.4.16/dbxml with-berkeleydb=/export/home/kaja/BDB/dbxml-2.4.16/db-4.6.21 with-xerces=/export/home/kaja/BDB/dbxml-2.4.16/xerces-c-src with-xqilla=/export/home/kaja/BDB/dbxml-2.4.16/xqilla
    Is there anything I'm missing or I have gone wrong? Please help me. I want to build bdb-xml with Java support.
    Thanks in advance,
    With regards,
    R Kaja Mohideen
    Edited by: mail4kaja on Sep 1, 2010 8:07 PM - Modified Title to DBXML-2.5.16

    Hi all,
    I have tried using that -xarch=v9 in my build. But, that didn't help me. So, I just though of using the latest BDBXML hoping that it will support me.
    I want to build BDBXML-2.5.16 that will be used my two applications (C++ & Java).
    C++ Application will create environment, containers and put documents in the containers.
    Java Application will read/query the document contents.
    My machine details.
    uname -a
    SunOS ltesol1 5.10 Generic_137111-03 sun4u sparc SUNW,Sun-Fire-480R
    cc -V
    cc: Sun C 5.9 SunOS_sparc Patch 124867-09 2008/11/25
    CC -V
    CC: Sun C++ 5.9 SunOS_sparc Patch 124863-05 2008/06/03
    make --version
    GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
    Built for sparc-sun-solaris2.9
    Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
    Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    Report bugs to <[email protected]>.
    Following are the commands I have used to trigger my BDBXML-2.5.16 build.
    export CFLAGS="-I/usr/jdk/instances/jdk1.5.0/include -I/usr/jdk/instances/jdk1.5.0/include/solaris"
    export CXXFLAGS="-library=stlport4 -library=Crun -I/usr/jdk/instances/jdk1.5.0/include -I/usr/jdk/instances/jdk1.5.0/include/solaris"
    ./buildall.sh prefix=/var/tmp/a22189/kaja/Install-2.5.16 -c cc -x CC enable-java with-dbxml=/var/tmp/a22189/kaja/dbxml-2.5.16/dbxml with-berkeleydb=/var/tmp/a22189/kaja/dbxml-2.5.16/db-4.8.26 with-berkeleydb-conf="enable-posixmutexes with-mutex=POSIX/pthreads" with-xerces=/var/tmp/a22189/kaja/dbxml-2.5.16/xerces-c-src --with-xqilla=/var/tmp/a22189/kaja/dbxml-2.5.16/xqilla
    And, I'm getting the following xerces linking issue
    Undefined first referenced
    symbol in file
    bool xercesc_3_0::DOMLSSerializerImpl::canSetParameter(const unsigned short*,bool)const .libs/XPath2NodeSerializer.o
    bool xercesc_3_0::DOMLSSerializerImpl::canSetParameter(const unsigned short*,const void*)const .libs/XPath2NodeSerializer.o
    void xercesc_3_0::DOMLSSerializerImpl::setParameter(const unsigned short*,bool) .libs/XPath2NodeSerializer.o
    void xercesc_3_0::DOMLSSerializerImpl::setParameter(const unsigned short*,const void*) .libs/XPath2NodeSerializer.o
    const void*xercesc_3_0::DOMLSSerializerImpl::getParameter(const unsigned short*)const .libs/XPath2NodeSerializer.o
    ld: fatal: Symbol referencing errors. No output written to .libs/libxqilla.so.5.0.2
    make[1]: *** [libxqilla.la] Error 1
    make[1]: Leaving directory `/var/tmp/a22189/kaja/dbxml-2.5.16/xqilla/build'
    make: *** [all-recursive] Error 1
    Please help me resolve this build issue.
    Thanks & regards,
    R Kaja Mohideen

  • "Fatal error, run database recovery " when there are no txns to recover.

    Hi, all.
    I have a DB file containing multiple databases. Without using DBEnvironments, I can open it to get the dbnames. I can open the databases RDONLY,
    and see that their contents are correct. I can open them RW, and everything works.
    But when I try to create a new one, I get this:
    D = bsddb3.db.DB()
    D.open('test.db',dbname='test',dbtype=B.DB_BTREE,flags=B.DB_CREATE)Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    bsddb3.db.DBRunRecoveryError: (-30974, 'DB_RUNRECOVERY: Fatal error, run database recovery -- PANIC: fatal region error detected; run recovery')
    Note that this is in the non-transactional case. There is no Env, and there are no logfiles or __db files. So the error code mystifies me.
    Strace shows that the file is opened RW, and read through.
    B.DB_VERSION_STRING'Berkeley DB 4.8.24: (August 14, 2009)'
    >>>
    So, where to proceed? Many thanks for any and all help.

    Hmm. Other thing to note:
    [tradedesk@vader 2010-05-06.test]$ /usr/local/BerkeleyDB.4.8/bin/db_verify foo.db
    db_verify: Subdatabase entry references page 266 of invalid type 13
    db_verify: Page 0: non-invalid page 40 on free list
    db_verify: trading.db: DB_VERIFY_BAD: Database verification failed
    Not sure how that came about or how to prevent it, but it might have to do wit this issue.

  • Error installing 2.4.13 with db-4.7.25

    I get the following error, which seems to show the configure script getting a goofed-up value for DB version: "4.6\n4.7":
    sh buildall.sh enable-java with-tcl=/path/to/x86-64-linux/tcl/lib with-junit=/path/to/x86-64-linux/lib/junit-4.4.jar enable-perl with-berkeleydb-prefix=/path/to/x86-64-linux/db-4.7.25 -b 64 prefix=/path/to/x86-64-linux/dbxml-2.4.13 --build-one=dbxml
    checking if --with-berkeleydb=DIR option specified... /path/to/x86-64-linux/dbxml-2.4.13
    checking for Berkeley DB version from install tree... 4.6
    4.7
    configure: error: /path/to/x86-64-linux/dbxml-2.4.13 is version 4.6
    4.7, which is not a supported version of Berkeley DB. The version must be at least 4.3
    Yorick

    First of all, thank you for the reply.
    Undertood I've downloaded the newer version and it installed fine.
    Thanks a lot!

  • Getting compiler error when running EnvExample.cpp

    Hi All,
    Im a newbie to use Berkeley DB and facing the problem when running the EnvExample.cpp.
    Please let me know what could be the problem??
    here is the command I used to run and the error I got.
    gcc -I/usr/local/BerkeleyDB.4.5/include EnvExample.cpp -L/usr/local/BerkeleyDB.4.5/lib -ldb_cxx-4.5
    In file included from /usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../include/c++/4.0.0/backward/iostream.h:31,
    from /usr/local/BerkeleyDB.4.5/include/db_cxx.h:60,
    from EnvExample.cpp:19:
    /usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../include/c++/4.0.0/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
    In file included from EnvExample.cpp:19:
    /usr/local/BerkeleyDB.4.5/include/db_cxx.h:61:23: error: exception.h: No such file or directory
    /usr/local/BerkeleyDB.4.5/include/db_cxx.h:1053: error: expected class-name before ‘{’ token
    Thanks
    Senthil
    Message was edited by:
    user586105

    Hi Senthil,
    A few pointers:
    Since you are compiling the C++ version, you should probably be using g++, not gcc.
    The problem is probably that you don't have the HAVE_CXX_STDHEADERS flag defined. Try running the following instead:
    g++ -DHAVE_CXX_STDHEADERS -I/usr/local/BerkeleyDB.4.5/include EnvExample.cpp -L/usr/local/BerkeleyDB.4.5/lib -ldb_cxx-4.5Let us know if that helps.
    - Alex

  • Error when building csv example

    We built and installed Berkeley DB db-4.5.20.NC under RedHat Linux 7.3 with no issues. When we attempt to build the examples_c/csv example, we get the following:
    cc -I. -I/usr/local/BerkeleyDB.4.4/include -g -W -Wall -Wpointer-arith -Wmissing-prototypes -c -o db.o db.c
    db.c: In function `csv_env_open':
    db.c:91: incompatible type for argument 4 of indirect function call
    db.c:91: too many arguments to function
    db.c: In function `csv_secondary_open':
    db.c:197: incompatible type for argument 4 of indirect function call
    db.c:197: too many arguments to function
    db.c:202: warning: passing arg 3 of pointer to function from incompatible pointer type
    db.c:202: warning: passing arg 4 of pointer to function makes integer from pointer without a cast
    db.c:202: too many arguments to function
    make: *** [db.o] Error 1
    We have searched the forum and online with no luck. Any tips/suggestions would be appreciated.
    Thanks,

    It appears that the csv example is referencing the DB 4.4 libraries in the Makefile in the 4.5.20 tarball.That is correct, we will update the paths and include the update in the next release.
    It is likely that you will need to update these paths anyway, unless they have installed Berkeley DB in the default location.
    If you have run "make install", and left the default install root, it should be enough to change the lines in the Makefile to:
    DB_INCLUDE=/usr/local/BerkeleyDB.4.5/include
    DB_LIBRARY=/usr/local/BerkeleyDB.4.5/lib
    If you have not run "make install", but are just building locally to test, the best alternative paths are probably:
    DB_INCLUDE=../../build_unix
    DB_LIBRARY=../../build_unix/.libs
    Thanks for pointing this out to us.
    Regards,
    Alex

  • Error opening environment more than once

    Hi,
    I have two java classes which both need to access a container in an environment (in parallel). When the first class is instantiated the environment is opened successfully. However, when the second class subsequently attempts to open the same environment I get an error. (I do not want to close the env from the first class, while the second class does its thing)
    The classes are Stylesheet extensions for an xmleditor which allows the stylesheet to look up item ID codes and display their names to the user by looking up the values in an xml file stored in a bdbxml container. There is a situation where two different objects need to have access to the environment at the same time - but its giving me an error when I instantiate the env for the second time - without having closed the first one)
    Any help would by gratefully received
    Kind Regards
    Swami Kevala
    I thought I could create multiple handles to the same environment?

    First is a class to encapsulate the environment (lifted mostly from the example code)
    package org.isha.archives.bdbxml;
    import java.io.*;
    import java.util.*;
    import com.sleepycat.db.*;
    import com.sleepycat.dbxml.*;
    //Class used to open and close a Berkeley DB environment
    public class DbEnv
    private Environment dbEnv_ = null;
    private XmlManager mgr_ = null;
    private boolean dbEnvIsOpen_ = false;
    private File path2DbEnv_ = null;
    public DbEnv(File path2DbEnv)
         throws Throwable {
              if (! path2DbEnv.isDirectory()) {
                   throw new Exception(path2DbEnv.getPath() +
                             " does not exist or is not a directory.");
              EnvironmentConfig config = new EnvironmentConfig();
              config.setCacheSize(50 * 1024 * 1024);
              config.setAllowCreate(true);
              config.setInitializeCache(true);
              config.setTransactional(true);
              config.setInitializeLocking(true);
              config.setInitializeLogging(true);
              config.setErrorStream(System.err);
              config.setThreaded(true);
              config.setRunRecovery(true);
              config.setLogAutoRemove(true);
              dbEnv_ = new Environment(path2DbEnv, config);
              //Boolean used to know whether to close the environment
              // when the cleanup() method is called.
              dbEnvIsOpen_ = true;
              path2DbEnv_ = path2DbEnv;
              mgr_ = new XmlManager(dbEnv_, null);
    //Returns the path to the database environment
    public File getDbEnvPath() { return path2DbEnv_; }
    //Returns the database environment encapsulated by this class.
    public Environment getEnvironment() { return dbEnv_; }
    //Returns the XmlManager encapsulated by this class.
    public XmlManager getManager() { return mgr_; }
    //Used to close the environment
    public void cleanup() throws DatabaseException
    if (dbEnvIsOpen_) {
    dbEnv_.close();
    dbEnvIsOpen_ = false;
    Second is a class which encapsulates a container with a method for querying itself
    package org.isha.archives.bdbxml;
    import java.io.*;
    import java.util.*;
    import com.sleepycat.db.*;
    import com.sleepycat.dbxml.*;
    //Class used to open, query and close a Berkeley DB container
    public class DbContainer
         private XmlContainer dbCont_ = null;
    private XmlManager mgr_ = null;
    private boolean dbContainerIsOpen_ = false;
    private File path2DbContainer_ = null;
    private XmlContainerConfig cfg_= null;
    private String cntr_ = "";
    public DbContainer(XmlManager myManager, String containerFileName, XmlContainerConfig containerConfig)
              throws Throwable {
              String containerFilepath = myManager.getHome() + "\\" + containerFileName;
              path2DbContainer_ = new File(containerFilepath);
              mgr_ = myManager;
              cfg_ = containerConfig;
              cntr_ = containerFileName;
              if (! path2DbContainer_.isFile()) {
                   throw new Exception(path2DbContainer_.getPath() +
                             " does not exist or is not a directory.");
              dbCont_ = new XmlContainer();
    //Return the XmlContainer itself
    public XmlContainer getContainer() { return dbCont_; }
    //Returns the filename of the container
         public String getFilename() { return cntr_; }
    //Returns the XmlManager encapsulated by this class.
    public XmlManager getManager() { return mgr_; }
    //Used to close the container
    public void close() throws DatabaseException
    if (dbContainerIsOpen_) {
    dbCont_.close();
    dbContainerIsOpen_ = false;
    //Used to open the container
    public void open() {
              try {
                   dbCont_ = mgr_.openContainer(cntr_, cfg_);
                   dbContainerIsOpen_ = true;
              catch (Exception e) {
    //Used to query the container
    public String[] runQuery(String myQuery){
              String [] queryOutput = null;
              int counter = 0;
              try {
                   XmlQueryContext context = mgr_.createQueryContext();
                   //Default namespace declaration does not work yet - this will work in the next release of BDB XML
                   //Until then we have to remove the namespace declaration from the reference.xml root element
                   //When this becomes available we can add the namespace declaration and uncomment the following line
                   //context.setNamespace("", defaultNS);
                   XmlResults results = mgr_.query(myQuery, context);
                   //Get the result set
                   queryOutput = new String[results.size()];
                   XmlValue value = results.next();
                   while (value != null)
                        queryOutput[counter] = value.asString().replaceAll("\\n", "").replaceAll(" "," ");
                        System.out.println(queryOutput[counter]);
                        counter ++;
                        value = results.next();
              catch (Exception e) {
                   //Exception Handling code here
              return queryOutput;
    Now to explain what is happening:
    When I open an xml document in xmlmind, it displays the document according to a prespecified CSS sheet. Sometimes the CSS rules alone are not sufficient to achieve the necessary effect/functionality, so the API allows you to write your own class, which contains methods to do what you want. As soon as the xml document is displayed, the CSS extension class gets instantiated.
    Here is my extension class (called StyleSheetExtension). It contains a method called getKeywords. This method can then be invoked from within the CSS sheet, and is used to replace the keyword ID codes in the xml document with their corresponding keyword names - stored in an xml reference look-up document...
    package org.isha.archives.xmlmind;
    import com.xmlmind.xmledit.xmlutil.*;
    import com.xmlmind.xmledit.doc.*;
    import com.xmlmind.xmledit.view.DocumentView;
    import com.xmlmind.xmledit.stylesheet.StyleValue;
    import com.xmlmind.xmledit.stylesheet.StyleSpec;
    import com.xmlmind.xmledit.stylesheet.StyleSpecsBase;
    import com.xmlmind.xmledit.styledview.StyledViewFactory;
    import com.xmlmind.xmledit.styledview.CustomViewManager;
    import com.sleepycat.dbxml.*;
    import com.sleepycat.db.*;
    import java.io.File;
    import java.util.logging.*;
    import java.util.*;
    import org.isha.archives.bdbxml.DbContainer;
    import org.isha.archives.bdbxml.DbEnv;
    public class StyleSheetExtension {
         //Logging variables
         private Logger logger = Logger.getLogger("StyleSheetExtension");
         private Handler fh = null;
         private java.util.logging.Formatter sf = null;
         //XMLMind variables
         private static final Namespace NS = Namespace.get("http://www.ishafoundation.org/archives/schema/transcript");
         //BDB variables
         private DbEnv myDbEnv = null;
         private File envDir = new File("C:\\BerkeleyDB");
         private DbContainer myDbContainer = null;
         private String containerFileName = "reference.dbxml";
         private XmlContainerConfig containerCfg = null;
         //Define Constructor
         public StyleSheetExtension(String[] args, StyledViewFactory viewFactory) {
    //Set up simple logging system
    try {
    fh = new FileHandler("%t/_styleSheetExtn.log");
    sf = new SimpleFormatter();
    fh.setFormatter(sf);
    logger.addHandler(fh);
    logger.setLevel(Level.ALL);
    logger.info("Starting StyleSheetExtension Class constructor");
    } catch (Exception e)
    {System.out.println("CustomErr: " + e.getMessage());
                    //Exception Handling code
    //Create custom BDB Environment and Container Objects
    try {
                        myDbEnv = new DbEnv(envDir);
                        containerCfg = new XmlContainerConfig();
                        myDbContainer = new DbContainer(myDbEnv.getManager(), containerFileName, containerCfg);
                        myDbContainer.open();
                   } catch (Throwable t) {
                        logger.severe("Problem with Env or Container new thing");
    viewFactory.addDependency( NS, "topic", NS, "keywordIDs");
         public StyleValue getKeywords (StyleValue[] args, Node contextNode,
                             StyledViewFactory viewFactory) {
    //Get keyword IDs as a String array
    String[] keywordID = null;
    String[] keywordValue = null;
    String keywordIDStr = "";
    String keywordValueStr ="";
    Name keywordIDs = Name.get("keywordIDs");
    keywordIDStr = contextNode.attributeValue(keywordIDs).trim();
    keywordID = keywordIDStr.split("\\s+");
    keywordValue = new String[keywordID.length];
    //for each keyword ID element retrieve the corresponding keyword value
    logger.info("getting values");
                   keywordValue = getKeywordValuesFromDB(keywordID);
                   Arrays.sort(keywordValue);
                   logger.info(keywordValue[0] + " " + keywordValue[1]);
                   int i = 0;
                   for(i=0; i < keywordID.length; i++) {
                        keywordValueStr += keywordValue[i] + " ";
                   keywordValueStr = keywordValueStr.trim();
              return StyleValue.createString(keywordValueStr);
    private String[] getKeywordValuesFromDB(String[] IDs){
                   String[] values = new String[IDs.length];
                   String id = "";
                   String value = "";
                   String flwor = "";
                   int i = 0;
                   for(i=0; i < IDs.length; i++) {
                        id = IDs.trim();
                        flwor = "for $i in collection('" + myDbContainer.getFilename() + "') /reference/keywords/keyword \n";
                        flwor += "let $id := $i/@id/text() \n";
                        flwor += "let $val := $i/@value/text() \n";
                        flwor += "where $id = '" + id + "'\n";
                        flwor += "return $val";
                        String[] temp = new String[1];
                        temp = myDbContainer.runQuery(flwor);
                        values[i] = temp[0];
                        logger.info("value is: " + values[i]);
                   return values;
    package org.isha.archives.xmlmind;
    import com.xmlmind.xmledit.xmlutil.*;
    import com.xmlmind.xmledit.doc.*;
    import com.xmlmind.xmledit.view.DocumentView;
    import com.xmlmind.xmledit.stylesheet.StyleValue;
    import com.xmlmind.xmledit.stylesheet.StyleSpec;
    import com.xmlmind.xmledit.stylesheet.StyleSpecsBase;
    import com.xmlmind.xmledit.styledview.StyledViewFactory;
    import com.xmlmind.xmledit.styledview.CustomViewManager;
    import com.sleepycat.dbxml.*;
    import com.sleepycat.db.*;
    import java.io.File;
    import java.util.logging.*;
    import java.util.*;
    import org.isha.archives.bdbxml.DbContainer;
    import org.isha.archives.bdbxml.DbEnv;
    public class StyleSheetExtension {
         //Logging variables
         private Logger logger = Logger.getLogger("StyleSheetExtension");
         private Handler fh = null;
         private java.util.logging.Formatter sf = null;
         //XMLMind variables
         private static final Namespace NS = Namespace.get("http://www.ishafoundation.org/archives/schema/transcript");
         //BDB variables
         private DbEnv myDbEnv = null;
         private File envDir = new File("C:\\BerkeleyDB");
         private DbContainer myDbContainer = null;
         private String containerFileName = "reference.dbxml";
         private XmlContainerConfig containerCfg = null;
         //Define Constructor
         public StyleSheetExtension(String[] args, StyledViewFactory viewFactory) {
    //Set up simple logging system
    try {
    fh = new FileHandler("%t/_styleSheetExtn.log");
    sf = new SimpleFormatter();
    fh.setFormatter(sf);
    logger.addHandler(fh);
    logger.setLevel(Level.ALL);
    logger.info("Starting StyleSheetExtension Class constructor");
    } catch (Exception e)
    {System.out.println("CustomErr: " + e.getMessage());
                    //Exception Handling code
    //Create custom BDB Environment and Container Objects
    try {
                        myDbEnv = new DbEnv(envDir);
                        containerCfg = new XmlContainerConfig();
                        myDbContainer = new DbContainer(myDbEnv.getManager(), containerFileName, containerCfg);
                        myDbContainer.open();
                   } catch (Throwable t) {
                        logger.severe("Problem with Env or Container new thing");
    viewFactory.addDependency( NS, "topic", NS, "keywordIDs");
         public StyleValue getKeywords (StyleValue[] args, Node contextNode,
                             StyledViewFactory viewFactory) {
    //Get keyword IDs as a String array
    String[] keywordID = null;
    String[] keywordValue = null;
    String keywordIDStr = "";
    String keywordValueStr ="";
    Name keywordIDs = Name.get("keywordIDs");
    keywordIDStr = contextNode.attributeValue(keywordIDs).trim();
    keywordID = keywordIDStr.split("\\s+");
    keywordValue = new String[keywordID.length];
    //for each keyword ID element retrieve the corresponding keyword value
    logger.info("getting values");
                   keywordValue = getKeywordValuesFromDB(keywordID);
                   Arrays.sort(keywordValue);
                   logger.info(keywordValue[0] + " " + keywordValue[1]);
                   int i = 0;
                   for(i=0; i < keywordID.length; i++) {
                        keywordValueStr += keywordValue[i] + " ";
                   keywordValueStr = keywordValueStr.trim();
              return StyleValue.createString(keywordValueStr);
    private String[] getKeywordValuesFromDB(String[] IDs){
                   String[] values = new String[IDs.length];
                   String id = "";
                   String value = "";
                   String flwor = "";
                   int i = 0;
                   for(i=0; i < IDs.length; i++) {
                        id = IDs[i].trim();
                        flwor = "for $i in collection('" + myDbContainer.getFilename() + "') /reference/keywords/keyword \n";
                        flwor += "let $id := $i/@id/text() \n";
                        flwor += "let $val := $i/@value/text() \n";
                        flwor += "where $id = '" + id + "'\n";
                        flwor += "return $val";
                        String[] temp = new String[1];
                        temp = myDbContainer.runQuery(flwor);
                        values[i] = temp[0];
                        logger.info("value is: " + values[i]);
                   return values;
    This instance (and consequently the newly created env and container objects) stay alive until the document is closed.
    The xmlmind API also allows you to specify custom classes that will return a component that can be embedded in the stylesheet. (My class returns a JButton which - when clicked - brings up a dialog box which allows the user to specify /modify/addnew keywords to the selected text). As soon as the button is pressed I create a new env and container instance, for the duration of the pop-up window (since I have no way to pass the reference to the existing environment created by the StyleSheetExtension class.
    Here's the class defn: (Here goes!) The env and container stuff is at the start of the nested-nested class called KpForm.
    package org.isha.archives.xmlmind;
    import com.sleepycat.dbxml.*;
    import com.sleepycat.db.*;
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.AbstractDocument;
    import javax.swing.text.DocumentFilter;
    import javax.swing.text.BadLocationException;
    import javax.swing.event.*;
    import javax.swing.text.DocumentFilter.FilterBypass;
    import java.util.*;
    import java.util.regex.*;
    import java.lang.*;
    import com.xmlmind.xmledit.xmlutil.*;
    import com.xmlmind.xmledit.doc.Element;
    import com.xmlmind.xmledit.edit.*;
    import com.xmlmind.xmledit.stylesheet.*;
    import com.xmlmind.xmledit.styledgadget.*;
    import com.xmlmind.xmledit.styledview.*;
    import com.xmlmind.xmledit.doc.*;
    import java.util.logging.*;
    import org.isha.archives.bdbxml.DbEnv;
    import org.isha.archives.bdbxml.DbContainer;
    public class OpenKeywordPicker implements ComponentFactory {
    public Component createComponent(Element element,
    Style style, StyleValue[] parameters,
    StyledViewFactory viewFactory,
    boolean[] stretch){
    KeywordEdit topic = new KeywordEdit();
    return topic;
         private class KeywordEdit extends JButton {
              //private Element element;
              public KeywordEdit()
                   super.setText("Edit");
                   super.addMouseListener(new java.awt.event.MouseAdapter() {
                                  public void mouseClicked(java.awt.event.MouseEvent evt) {
                                       myJButtonMouseClicked(evt);
              private void myJButtonMouseClicked(java.awt.event.MouseEvent evt) {
                        KpForm myForm = new KpForm();
                        myForm.setVisible(true);
    private class KpForm extends javax.swing.JFrame {
         // Variables declaration - do not modify
         private javax.swing.JButton jButton1;
         private javax.swing.JButton jButton2;
         private javax.swing.JButton jButton3;
         private javax.swing.JButton jButton4;
         private javax.swing.JButton jButton5;
         private javax.swing.JButton jButton6;
         private javax.swing.JLabel jLabel1;
         private javax.swing.JLabel jLabel2;
         private javax.swing.JLabel jLabel3;
         private javax.swing.JLabel jLabel4;
         private javax.swing.JLabel jLabel5;
         private javax.swing.JList jList1;
         private javax.swing.JList jList2;
         private javax.swing.JList jList3;
         private javax.swing.JScrollPane jScrollPane1;
         private javax.swing.JScrollPane jScrollPane2;
         private javax.swing.JScrollPane jScrollPane3;
         private javax.swing.JScrollPane jScrollPane4;
         private javax.swing.JTextArea jTextArea1;
         private javax.swing.JTextField jTextField1;
         private DefaultListModel model_1 = new DefaultListModel();
              private DefaultListModel model_2 = new DefaultListModel();
              private DefaultListModel model_3 = new DefaultListModel();
              private javax.swing.JOptionPane jOptionPane1;
              //private KeywordFilter filter_1 = new KeywordFilter();
              //BDB variables
              private DbEnv myDbEnv = null;
              private File envDir = new File("C:\\BerkeleyDB");
              private DbContainer myDbContainer = null;
              private String containerFileName = "reference.dbxml";
              private XmlContainerConfig containerCfg = null;
              private Logger logger = Logger.getLogger("OpenKeywordPicker.KeywordEdit.KpForm");
              private Handler fh = null;
              private java.util.logging.Formatter sf = null;
    // End of variables declaration
         /** Creates new form kpForm */
         public KpForm() {
                   super();
         initComponents();
         customInit();
              private void customInit(){
                        //Set up simple logging system
                   try {
                        fh = new FileHandler("%t/_keywordPicker.log");
                        sf = new SimpleFormatter();
                        fh.setFormatter(sf);
                        logger.addHandler(fh);
                        logger.setLevel(Level.ALL);
                        logger.info("Starting Custom initialization");
                   } catch (Exception e) {System.out.println("CustomErr: " + e.getMessage());
                              //Exception Handling code
                        //Create custom BDB Environment and Container Objects
                        try {
                             logger.info("0");
                             myDbEnv = new DbEnv(envDir);
                             logger.info("1");
                             containerCfg = new XmlContainerConfig();
                             logger.info("2");
                             myDbContainer = new DbContainer(myDbEnv.getManager(), containerFileName, containerCfg);
                             logger.info("3");
                             myDbContainer.open();
                        } catch (Throwable t) {
                             logger.severe("Problem with Env or Container new thing - Component: "+ t.getMessage());
              String[] dbIDKeywords;
              jList1.setModel(model_1);
              jList2.setModel(model_2);
              jList3.setModel(model_3);
              dbIDKeywords = getKeywordsFromDB();
              int i=0;
              for(i=0; i < dbIDKeywords.length; i+=2){
              model_1.addElement(new keywordOb(dbIDKeywords[i], dbIDKeywords[i+1]));
              jList1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              jList2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              jList3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              //Setup Document Filter for TextField component
              AbstractDocument doc;
              doc = (AbstractDocument)(jTextField1.getDocument());
              doc.setDocumentFilter(filter_1);
              //Setup Document Listener for TextField component
              jTextField1.getDocument().addDocumentListener(new DocumentListener(){
              public void insertUpdate(DocumentEvent e) {
              String val = jTextField1.getText();
              if(val != null & val.trim() != ""){
              jButton1.setEnabled(true);
              else {
              jButton1.setEnabled(false);
              public void removeUpdate(DocumentEvent e) {
              String val = jTextField1.getText();
              if(val != null & !val.trim().equals("")){
              jButton1.setEnabled(true);
              else {
              jButton1.setEnabled(false);
              public void changedUpdate(DocumentEvent e) {
              //Plain text components do not fire these events
              private String[] getKeywordsFromDB(){
              String[] k = null;
              String flwor = "";
              flwor = "for $i in collection('" + containerFileName + "') /reference/keywords/keyword \n";
              flwor += "let $id := $i/@id/text() \n";
              flwor += "let $val := $i/@value/text() \n";
              flwor += "order by $val ascending \n";
              flwor += "return ($id, $val)";
              return k = myDbContainer.runQuery(flwor);
              private class keywordOb implements Comparable{
              private String id;
              private String value;
              public keywordOb(String id, String value){
              this.id = id;
              this.value = value;
              public String getId(){
              return id;
              public String getValue(){
              return value;
              public String toString(){
              return value;
              public int compareTo(Object o){
                                  int result = (((keywordOb)this).toString()).compareTo(((keywordOb)o).toString());
                                  return result;
              private class questionOb implements Comparable{
              private String id;
              private String value;
              private String[] keywordRefs;
              public questionOb(String id, String value, String[] keywordRefs){
              this.id = id;
              this.value = value;
              this.keywordRefs = keywordRefs;
              public questionOb(){
              this.id = "";
              this.value = "";
              this.keywordRefs = null;
              public String getId(){
              return id;
              public String getValue(){
              return value;
              public String toString(){
              return value;
              public String[] getKeywordRefs(){
              return keywordRefs;
              public void setId(String id){
              this.id = id;
              public void setValue(String value){
              this.value = value;
              public void setKeywordRefs(String[] keywords){
              this.keywordRefs = keywordRefs;
              public int compareTo(Object o){
                             int result = (((questionOb)this).toString()).compareTo(((questionOb)o).toString());
                             return result;
              //Add New Keyword to xml reference File
              private void addNewKeyword(String k){
              String keyword = k;
              int len = jTextField1.getDocument().getLength();
              //Tidy up string
              keyword = keyword.trim();
              keyword = keyword.replaceAll("\\s+"," ");
              keyword = capitalizeWords(keyword);
              String flwor = "";
              //Check that the keyword value doesn't already exist
              flwor = "let $i := collection('" + containerFileName + "')/reference/keywords/keyword[@value = '" + keyword + "'] \n";
              flwor += "return \n";
              flwor += "if(count($i)) then fn:true() \n";
              flwor += "else fn:false() \n";
              boolean keywordExists = bDbConnection.runBooleanQuery(flwor);
              if (keywordExists){
              jOptionPane1.showMessageDialog(new Frame(),
              "The keyword '" + keyword + "' already exists", "Message", jOptionPane1.INFORMATION_MESSAGE);
              try {
              jTextField1.getDocument().remove(0,len);
              } catch (Exception ex) {
              ex.printStackTrace();
              //Terminate method execution
              return;
              //Need to get ID of last keyword
              flwor = "for $i in collection('" + containerFileName + "')/reference/keywords/keyword/@id/text() \n";
              flwor += "order by $i descending \n";
              flwor += "return $i[fn:last()]";
              String[] lastIDArray = new String[1];
              lastIDArray = bDbConnection.runQuery(flwor);
              String lastIDStr = lastIDArray[0];
              //create incremented ID value
              //Note: XML ID attributes must start with a letter - that's why we need to do all this nonsense!
              int lastIDNum = new Integer(lastIDStr.substring(1));
              int nextIDNum = ++lastIDNum;
              String nextIDStr = String.format("%04d", nextIDNum);
              nextIDStr = "K" + nextIDStr;
              //OK Finally - actually add the keyword to the xml reference file
              //use BDB API for updating - since XQuery does not allow
              try
              XmlQueryContext qc = myManager.createQueryContext();
              XmlUpdateContext uc = myManager.createUpdateContext();
              XmlModify mod = myManager.createModify();
              XmlQueryExpression select = myManager.prepare("/reference/keywords", qc);
              mod.addAppendStep(select, XmlModify.Element, "keyword", "");
              select = myManager.prepare("/reference/keywords/keyword[fn:last()]", qc);
              mod.addAppendStep(select, XmlModify.Attribute, "id", nextIDStr);
              mod.addAppendStep(select, XmlModify.Attribute, "value", keyword);
              XmlDocument updateDoc = myContainer.getDocument(docName);
              XmlValue docValue = new XmlValue(updateDoc);
              mod.execute(docValue, qc, uc);
              catch(Exception e){
              System.out.println("Error adding keyword: " + e.getMessage());
              //Add the new keyword to the list of selected keywords
              model_2.addElement(keyword);
              sortModelElements(model_2);
              try {
              jTextField1.getDocument().remove(0,len);
              } catch (Exception ex) {
              ex.printStackTrace();
              private questionOb[] getQuestionsFromDB(keywordOb[] keywordIDs){
              questionOb[] qobs = null;
              String seq = "";
              String flwor = "";
              int num = 0;
              seq = keywordObsToSeq(keywordIDs);
              flwor = "for $i in " + seq + "\n";
              flwor += "let $q := collection('" + containerFileName + "') /reference/questions/question[./keywordRef/@idref/text() = $i] \n";
              flwor += "return $q";
              try
              XmlQueryContext context = myManager.createQueryContext();
              context.setEvaluationType(XmlQueryContext.Eager);
              context.setReturnType(XmlQueryContext.DeadValues);
              XmlResults results = myManager.query(flwor, context);
              // Report Query Info
              String message = "Found ";
              message += results.size() + " entries for query: '";
              message += flwor + "'\n";
              System.out.println(message);
              int numQuestions;
              numQuestions = results.size();
              qobs = new questionOb[numQuestions];
              String[] keyRefs = new String[1];
              String[] keyRefs2 = new String[1];
              XmlResults atts, atts2 = null;
              XmlValue keyRefElem, keyRefAtt = null;
              int i;
              for(i=0; i < numQuestions; i++){
              XmlValue val = results.next();
              atts = val.getAttributes();
              String id = atts.next().getNodeValue();
              String value = atts.next().getNodeValue();
              keyRefElem = val.getFirstChild();
              int j=0;
              while (!keyRefElem.isType(XmlValue.NONE)){
              if(keyRefElem.getType() == XmlValue.TEXT_NODE){
              keyRefElem = keyRefElem.getNextSibling();
              if(keyRefElem.isType(XmlValue.NONE)){
              break;
              System.out.println("1");
              atts2 = keyRefElem.getAttributes();
              System.out.println("2");
              keyRefs[j] = atts2.next().getNodeValue();
              System.out.println("3" + keyRefs[j]);
              System.arraycopy(keyRefs,0,keyRefs2,0,j+1);
              System.out.println("4");
              keyRefs = new String[j+2];
              System.out.println("5");
              System.arraycopy(keyRefs2,0,keyRefs,0,j+1);
              System.out.println("6");
              keyRefs2 = new String[j+2];
              System.out.println("7");
              keyRefElem = keyRefElem.getNextSibling();
              System.out.println("8");
              j++;
              System.out.println(keyRefs[0]+keyRefs[1]);
              //Create new Question Object with retrieved values
              System.out.println("bef");
              questionOb qo = new questionOb(id, value, keyRefs);
              System.out.println("aft");
              qobs[i] = qo;
                        catch(Exception e)
              System.out.println("XML Exception is "+ e.getMessage());
              return qobs;
              private void sortModelElements(DefaultListModel model){
              //Getting the size of the model
              int size = model.getSize();
              //Creating the keyword object based on the size of the model
              keywordOb[] word = new keywordOb[size];
              int i=0;
              //keywordOb j;
              for(i=0; i < size; i++){
              word[i] = (keywordOb) model.getElementAt(i);
              Arrays.sort(word);
              for(i=0; i < size; i++){
              //model.setElementAt(word[i], i);
              model.set(i,word[i]);
              public void messageBox(String message)
              jOptionPane1.showMessageDialog(new Frame(), message , "Message", jOptionPane1.INFORMATION_MESSAGE);
              class KeywordFilter extends DocumentFilter {
              public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr)
              throws BadLocationException {
              int len = fb.getDocument().getLength();
              if(len==0 & noFunnyChars(string) & !string.trim().equals("")){
              fb.insertString(offset, string, attr);
              if(len > 0 & noFunnyChars(string) & len < 30){
              fb.insertString(offset, string, attr);
              public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr)
              throws BadLocationException {
              int len = fb.getDocument().getLength();
              if(len==0 & noFunnyChars(string) & !string.trim().equals("")){
              fb.replace(offset, length, string, attr);
              if(len > 0 & noFunnyChars(string) & len < 30){
              fb.insertString(offset, string, attr);
              private boolean noFunnyChars(String s){
              String regex = "[A-Za-z\\s]+";
              boolean b = Pattern.matches(regex, s);
              return b;
              private String capitalizeWords(String s){
              String s2;
              char[] c = s.toCharArray();
              int i = 0;
              c[0] = Character.toUpperCase(c[0]);
              for(i=0; i < c.length; i++){
              if (!Character.isLetter(c[i])){
              c[i+1] = Character.toUpperCase(c[i+1]);
              s2 = String.valueOf(c);
              return s2;
              private String keywordObsToSeq(keywordOb[] a) {
              StringBuffer result = new StringBuffer();
              String resultStr = "";
              result.append("('" + a[0].getId() + "', ");
              for (int i=1; i < a.length; i++) {
              result.append("'" + a[i].getId() + "', ");
              resultStr = result.toString();
              resultStr = resultStr.trim();
              resultStr = resultStr.substring(0,resultStr.length()-1) + ")";
              return resultStr;
         // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
              private void initComponents() {
              jScrollPane1 = new javax.swing.JScrollPane();
              jList1 = new javax.swing.JList();
              jScrollPane2 = new javax.swing.JScrollPane();
              jList2 = new javax.swing.JList();
              jLabel1 = new javax.swing.JLabel();
              jLabel2 = new javax.swing.JLabel();
              jLabel3 = new javax.swing.JLabel();
              jTextField1 = new javax.swing.JTextField();
              jButton1 = new javax.swing.JButton();
              jButton2 = new javax.swing.JButton();
              jButton3 = new javax.swing.JButton();
              jScrollPane3 = new javax.swing.JScrollPane();
              jList3 = new javax.swing.JList();
              jLabel4 = new javax.swing.JLabel();
              jButton4 = new javax.swing.JButton();
              jButton5 = new javax.swing.JButton();
              jLabel5 = new javax.swing.JLabel();
              jScrollPane4 = new javax.swing.JScrollPane();
              jTextArea1 = new javax.swing.JTextArea();
              jButton6 = new javax.swing.JButton();
              setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
              jList1.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseClicked(java.awt.event.MouseEvent evt) {
              jList1MouseClicked(evt);
              jScrollPane1.setViewportView(jList1);
              jList2.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseClicked(java.awt.event.MouseEvent evt) {
              jList2MouseClicked(evt);
              jScrollPane2.setViewportView(jList2);
              jLabel1.setText("Available Keywords");
              jLabel2.setText("Selected Keywords");
              jLabel3.setText("Add New Keyword");
              jTextField1.setFont(new java.awt.Font("Tahoma", 0, 12));
              jTextField1.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
              jTextField1ActionPerformed(evt);
              jButton1.setText("Add Keyword");
              jButton1.setEnabled(false);
              jButton1.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
              jButton1ActionPerformed(evt);
              jButton2.setText("Modify Keyword");
              jButton3.setText("Remove Keyword");
              jList3.setModel(new javax.swing.AbstractListModel() {
              String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
              public int getSize() { return strings.length; }
              public Object getElementAt(int i) { return strings[i]; }
              jScrollPane3.setViewportView(jList3);
              jLabel4.setText("Questions");
              jButton4.setText("OK");
              jButton4.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
              jButton4ActionPerformed(evt);
              jButton5.setText("Cancel");
              jLabel5.setText("Add New Question");
              jTextArea1.setColumns(20);
              jTextArea1.setRows(2);
              jScrollPane4.setViewportView(jTextArea1);
              jButton6.setText("Add Question");
              javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
              getContentPane().setLayout(layout);
              layout.setHorizontalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
              .addContainerGap(488, Short.MAX_VALUE)
              .addComponent(jButton5)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addGap(29, 29, 29))
              .addGroup(layout.createSequentialGroup()
              .addGap(38, 38, 38)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
              .addComponent(jButton6)
              .addContainerGap())
              .addGroup(layout.createSequentialGroup()
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
              .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE)
              .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
              .addComponent(jLabel5)
              .addComponent(jLabel4)
              .addGroup(layout.createSequentialGroup()
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel1)
              .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addGap(31, 31, 31)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel2)
              .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addGap(32, 32, 32)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addComponent(jLabel3)
              .addComponent(jButton1)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
              .addComponent(jButton2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addComponent(jButton3, javax.swing.GroupLayout.Alignment.LEADING))))
              .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE)))
              .addContainerGap(58, Short.MAX_VALUE))))
              layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
              .addGap(24, 24, 24)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
              .addGroup(layout.createSequentialGroup()
              .addComponent(jLabel1)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
              .addGroup(layout.createSequentialGroup()
              .addComponent(jLabel2)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addGroup(layout.createSequentialGroup()
              .addComponent(jLabel3)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jButton1)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addComponent(jButton2)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jButton3))))
              .addGap(29, 29, 29)
              .addComponent(jLabel4)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addGap(20, 20, 20)
              .addComponent(jLabel5)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jButton6)
              .addGap(31, 31, 31)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
              .addComponent(jButton4)
              .addComponent(jButton5))
              .addGap(21, 21, 21))
              pack();
    }// </editor-fold>
              //Event handlers
              private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
              // TODO add your handling code here:
                        try {
                             myDbContainer.close();
                             myDbEnv.cleanup();
                        } catch (Exception e) {
                             logger.info("Could not close container/or env - Component");
                        super.setVisible(false);
                        super.dispose();
                   private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
              // TODO add your handling code here:
                        String val;
                        val = jTextField1.getText();
                        if(val != null & val.trim() != "" & noFunnyChars(val) ){
                             jButton1.setEnabled(true);
                        else {
                             jButton1.setEnabled(false);
                   private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
              // TODO add your handling code here:
                   // Add new keyword to the xml reference file
                        //addNewKeyword(jTextField1.getText());
                   private void jList2MouseClicked(java.awt.event.MouseEvent evt) {
              // TODO add your handling code here:
                        if(evt.getClickCount() == 2) {
                             keywordOb k = (keywordOb)jList2.getSelectedValue();
                             model_2.removeElement(k);
                             model_1.addElement(k);
                             sortModelElements(model_1);
                             questionOb q = null;
                             //Remove associated questions from listbox
                             int i,j;
                             for(i=0; i < model_3.size(); i++){
                                  q = (questionOb)model_3.getElementAt(i);
                                  for(j=0; j < model_3.size(); j++){
                                       if (q.getKeywordRefs()[j].equals(k.getId())){
                                            model_3.removeElement(q);
                                            i--;
                                            break;
                   private void jList1MouseClicked(java.awt.event.MouseEvent evt) {
              // TODO add your handling code here:
                   if(evt.getClickCount() == 2) {
                             //Getting properties of the selecteditem item in jList1.
                        keywordOb k = (keywordOb)jList1.getSelectedValue();
                        //Removing the element from jList1
                        model_1.removeElement(k);
                        //Adding the element to jList2
                        model_2.addElement(k);
                        sortModelElements(model_2);
                        //Load the questions for the selected keywords
                        int len;
                        len = model_2.getSize();
                        keywordOb[] dbQuestionsOb = new keywordOb[5];
                        keywordOb[] selectedKeywordsOb = new keywordOb[len];
                        String[] selectedKeywordIDs = new String[len];
                        int i;
                        for(i=0; i < len; i++) {
                             selectedKeywordsOb[i] = (keywordOb)model_2.getElementAt(i);
                             selectedKeywordIDs[i] = selectedKeywordsOb[i].getId();
                        questionOb[] questionsOb = getQuestionsFromDB(selectedKeywordsOb);
                        model_3.removeAllElements();
                        for(i=0; i < questionsOb.length; i++){
                             model_3.addElement(questionsOb[i]);
                        // sortModelElements(model_3);
    I think thats too much code for one post!

Maybe you are looking for