Archived

This forum has been archived. Please start a new discussion on GitHub.

NoSuchMethodErrror: com.sleepycat.db.Db.close(I)I

When we try to call Freeze.Connection.close() in Java, we get this exception:

java.lang.NoSuchMethodError: com.sleepycat.db.Db.close(I)I
at Freeze.SharedDb.close(SharedDb.java:82)
at Freeze.Map.close(Map.java:450)
at Freeze.ConnectionI.close(ConnectionI.java:91)
at Freeze.ConnectionI.close(ConnectionI.java:41)

Questions:

1) Is this a configuration error on our end?
2) The manual says it is not necessary to explicitly close a connection, yet it the example does it for "completeness". Should we just not close the connection and avoid this problem or is closing still a good idea?

Thanks again,

Brian

Comments

  • mes
    mes California
    Brian,

    What version of BerkeleyDB are you using? And which platform and Java version?

    If you're not sure about the BerkeleyDB version, you can call com.sleepycat.db.DbEnv.get_version_string().

    - Mark
  • bernard
    bernard Jupiter, FL
    Hi Brian,

    For connection.close(), it is optional in C++ (as the destructor does the cleanup), but not in Java. In Java, you have to close your connections.

    Cheers,
    Bernard
  • Wow. Two responses. I feel special. Seriously though, thanks for the quick responses.

    Mark, I made that call and got:

    "Sleepycat Software: Berkeley DB 4.2.52: (December 3, 2003)"

    The Java version is 1.4.2_01-b06

    The platform is SunOS 5.8.

    Brian
  • mes
    mes California
    Brian,

    I believe you're getting this error because the Ice.jar file in the Ice for Java 1.3.0 distribution was compiled against BerkeleyDB 4.1.25. The signature for Db.close changed between 4.1.25 and 4.2.52. If you don't want to recompile Ice for Java yourself, you can download a new Ice.jar file from my post in the Patches forum.

    I'm sure it goes without saying, but let us know if this doesn't solve the problem. :)

    Take care,
    - Mark
  • Mark,

    Thanks! That appears to have fixed the problem.

    Brian