10101010101001

0101010101001

ORA-31201: DBMS_LDAP: generic error: Invalid BER ELEMENT

with 3 comments

Hello world,

This post is dedicated to this error which calls for “Please report the error number and description to Oracle Support”.

The most likely cause is that you are using the “dbms_ldap” code samples for oracle and after you perform a search on active directory that returns no results you try to free a null element using “DBMS_LDAP.ber_free(my_ber_elmt, 0);”
To get rid of the error replace the above statement with this one:

   if (my_ber_elmt is not null) then
    DBMS_LDAP.ber_free(my_ber_elmt, 0);
   end if;

What’s strange about this error it lists as cause: “There has been an error in the DBMS_LDAP package” and proposes as action “Please report the error number and description to Oracle Support”.
My guess is that the oracle programmers also forgot to do a null check and they tried to free a null element inside DBMS_LDAP.ber_free instead of checking for this case and throwing a custom exception.
Well, nobody’s perfect. I’m nobody :)

Advertisements

Written by Liviu Trifoi

January 30, 2009 at 6:39 pm

3 Responses

Subscribe to comments with RSS.

  1. OMG!!!! That’s *IT*. Sheesh. Thanks a bunch for this tip, I’ve been fighting with DBMS_LDAP for quite some time.

    Chris Yoder

    May 29, 2009 at 9:11 pm

  2. Exactly the information I needed – Thanks for taking the time to post it!

    Bryan Fowler

    July 17, 2009 at 2:31 pm

  3. In 1 minute you solved weeks of headache! Thanks a lot!

    Gabor Revesz

    February 28, 2011 at 10:28 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: