From directory-dev-return-4059-apmail-incubator-directory-dev-archive=incubator.apache.org@incubator.apache.org Wed Feb 02 00:32:23 2005 Return-Path: Delivered-To: apmail-incubator-directory-dev-archive@www.apache.org Received: (qmail 5322 invoked from network); 2 Feb 2005 00:32:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Feb 2005 00:32:22 -0000 Received: (qmail 28793 invoked by uid 500); 2 Feb 2005 00:32:22 -0000 Delivered-To: apmail-incubator-directory-dev-archive@incubator.apache.org Received: (qmail 28747 invoked by uid 500); 2 Feb 2005 00:32:21 -0000 Mailing-List: contact directory-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list directory-dev@incubator.apache.org Received: (qmail 28732 invoked by uid 99); 2 Feb 2005 00:32:21 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 01 Feb 2005 16:32:20 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (8.12.11/8.12.11) with ESMTP id j120WH10010638 for ; Wed, 2 Feb 2005 01:32:17 +0100 Message-ID: <1537232879.1107304337637.JavaMail.jira@ajax.apache.org> Date: Wed, 2 Feb 2005 01:32:17 +0100 (CET) From: "Emmanuel Lecharny (JIRA)" To: directory-dev@incubator.apache.org Subject: [jira] Updated: (DIRLDAP-28) ClassCast excpetion in org.apache.ldap.common.berlib.asn1.SnickersEncoder In-Reply-To: <216041159.1107095237399.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIRLDAP-28?page=history ] Emmanuel Lecharny updated DIRLDAP-28: ------------------------------------- Attachment: clients.tar.gz standelone package DOES NOT COMPILE actually. I don't think that this module is usefull anyway... > ClassCast excpetion in org.apache.ldap.common.berlib.asn1.SnickersEncoder > ------------------------------------------------------------------------- > > Key: DIRLDAP-28 > URL: http://issues.apache.org/jira/browse/DIRLDAP-28 > Project: Directory LDAP > Type: Bug > Components: Snickers Codec Provider > Versions: 0.8.0 > Environment: Not relevant > Reporter: Emmanuel Lecharny > Assignee: Alex Karasulu > Priority: Blocker > Attachments: clients.tar.gz > > I get a ClassCast exception while running LdapSearch main : > java.lang.ClassCastException > at org.apache.ldap.common.berlib.asn1.SnickersEncoder$OutputCallback.encodeOccurred(SnickersEncoder.java:177) > at org.apache.asn1.codec.stateful.AbstractStatefulEncoder.encodeOccurred(AbstractStatefulEncoder.java:130) > at org.apache.asn1.ber.TupleEncodingVisitor.flush(TupleEncodingVisitor.java:173) > at org.apache.ldap.common.berlib.asn1.encoder.SnickersLdapEncoder.encode(SnickersLdapEncoder.java:209) > at org.apache.ldap.common.berlib.asn1.SnickersEncoder.encodeBlocking(SnickersEncoder.java:66) > at org.apache.ldap.common.message.MessageEncoder.encodeBlocking(MessageEncoder.java:90) > at org.apache.ldap.clients.LdapBind.bind(LdapBind.java:350) > at org.apache.ldap.clients.LdapSearch.main(LdapSearch.java:408) > public void encodeOccurred(StatefulEncoder encoder, Object encoded) { > try > { > channel.write( ( ByteBuffer ) encoded ); <--- Object is supposed to be a ByteBuffer [], not a ByteBuffer > Substituing those lines to the one that cause the exception seems to correct it : > public void encodeOccurred(StatefulEncoder encoder, Object encoded) { > try > { > //channel.write( ( ByteBuffer ) encoded ); <--- Object is supposed to be a ByteBuffer [], not a ByteBuffer > ByteBuffer[] buffers = (ByteBuffer[])encoded; > > // int nbWritten = 0; // for debug sake > > for (int i=0; i //nbWritten += channel.write(buffers[i]); > channel.write(buffers[i]); > } > > // System.out.println("Bytes written (" + nbWritten + ") :"); > ... > No more exception, then, but, as far as I went, it does not help the whole thing to work correctly. I do not receive any answer from my favorite OpenLdap server. I'm currently checking the PDU to see if it's FUBR or not (ethereal to the rescue). Takes time... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira