Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1909

Integer cannot be cast to java.lang.Long in JdbmTable prevents service start

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0-M15
    • 2.0.0-M16
    • core
    • None

    Description

      During server start objects are being de-serialized and a cast statement is resulting in exception prevent the server to start.

      org.apache.directory.server.UberjarMain] - Failed to start the service.
      org.apache.directory.api.ldap.model.exception.LdapOtherException: java.lang.Integer cannot be cast to java.lang.Long

      at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable.<init>(JdbmTable.java:166)

      The first constructor in JdbmTable has following

      count = ( Long ) recMan.fetch( recId );

      The second constructor handles this issue, hence similar logic should be applied in first constructor.

      Object value = recMan.fetch( recId );

      if ( value instanceof Integer )
      {
      count = ( ( Integer ) value ).longValue();
      }
      else
      {
      count = ( Long ) value;
      }

      Tested in M16 snapshot build and it resolved the cast exception.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mdebusschere Mark DeBusschere
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: