directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark DeBusschere (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DIRSERVER-1909) Integer cannot be cast to java.lang.Long in JdbmTable prevents service start
Date Fri, 01 Nov 2013 17:45:19 GMT
Mark DeBusschere created DIRSERVER-1909:
-------------------------------------------

             Summary: Integer cannot be cast to java.lang.Long in JdbmTable prevents service
start
                 Key: DIRSERVER-1909
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1909
             Project: Directory ApacheDS
          Issue Type: Bug
          Components: core
    Affects Versions: 2.0.0-M15
            Reporter: Mark DeBusschere


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.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message