Forum Stats

  • 3,769,970 Users
  • 2,253,039 Discussions


Attempt to use non-open Environment object().

535385 Member Posts: 3
edited Sep 22, 2006 3:14PM in Berkeley DB Java Edition

I am trying initialize Environment,Database & View in my main thread and pass this Object to my thread to insert the data. I get following exception:
I know for sure I am initiating all the variables.
If I use everything in main program, it works OK.

com.sleepycat.util.RuntimeExceptionWrapper: (JE 3.0.12) Attempt to use non-open Environment object().
at com.sleepycat.collections.CurrentTransaction.<init>(
at com.sleepycat.collections.CurrentTransaction.getInstanceInternal(
at com.sleepycat.collections.DataView.<init>(
at com.sleepycat.collections.StoredSortedMap.<init>(
at com.mailman.bdb.MailOrderView.<init>(
at com.mailman.server.commands.InsertCommand.<init>(
at com.mailman.server.commands.CommandInvoker.getCommand(


  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690

    I'm not sure why this is happening -- it appears that the environment has been closed.

    The stack trace you are getting is from a RuntimeExceptionWrapper. Please unwrap this exception when you catch it and print the stack trace from the unwrapped exception as follows:

    import com.sleepycat.util.ExceptionUnwrapper;
    import com.sleepycat.util.RuntimeExceptionWrapper;

    // somewhere in your program you must catch the exception:

    try {
    // do the work here that causes the error
    } catch (RuntimeExceptionWrapper e) {
    e = ExceptionUnwrapper.unwrap(e);

    Please reply with the unwrapped stack trace -- this will tell me more about the cause of the problem.

  • 535385
    535385 Member Posts: 3
    As suggested I put following:
    catch (RuntimeExceptionWrapper e) {
    System.out.println("Inside RuntimeExceptionWrapper");
    Exception ex = ExceptionUnwrapper.unwrap(e);

    I got following:

    Inside RuntimeExceptionWrapper (JE 3.0.12) Attempt to use non-open Environm ent object().
    at )
    at com.sleepycat.collections.CurrentTransaction.<init>(CurrentTransactio
    at com.sleepycat.collections.CurrentTransaction.getInstanceInternal(Curr
    at com.sleepycat.collections.DataView.<init>(
    at com.sleepycat.collections.StoredSortedMap.<init>( :116)
  • 535385
    535385 Member Posts: 3
    Sorry. I found the bug in my code. Thank you for responding.
This discussion has been closed.