You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2013/11/01 19:07:18 UTC

[jira] [Commented] (DIRSERVER-1909) Integer cannot be cast to java.lang.Long in JdbmTable prevents service start

    [ https://issues.apache.org/jira/browse/DIRSERVER-1909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13811516#comment-13811516 ] 

Emmanuel Lecharny commented on DIRSERVER-1909:
----------------------------------------------

Good catch !

This is a modification I did back in july, but which has not been applied correctly to all the class. Thanks for the proposed patch, I'll apply it immediately.

> 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)