Home Help Center

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

brianbrian Member brian whitneyOrganization: boulder research and developmentProject: MarketBank ✭✭✭
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

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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
  • brianbrian Member brian whitneyOrganization: boulder research and developmentProject: MarketBank ✭✭✭
    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
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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
  • brianbrian Member brian whitneyOrganization: boulder research and developmentProject: MarketBank ✭✭✭
    Mark,

    Thanks! That appears to have fixed the problem.

    Brian
Sign In or Register to comment.