Error in finalizer after LDAP search with referrals
have rather weird problem.
Web application executes LDAP search against Active directory GC.
It does it in a standard steps:
1. Creates hash table with parameters
2. Creates InitialDirContext
3. Execute search using search objects, filter etc.
4. Enumerates result using hasMoreElements and next until the necessary object is found.
5. Closes NameEnumeration object and context object
If referral are not used, application is being executed without any problems.
If referrals ARE USED and object is found, no problems.
If enumeration does not contain any objects (the first hasMoreElements returns false) no exceptions are thrown immediately, but debugger stops while exciting finalizer.
System Thread [Finalizer thread] (Suspended at breakpoint (Throwable: uncaught))
LdapSearchEnumeration(LdapNamingEnumeration).cleanup() line: 420
LdapSearchEnumeration(LdapNamingEnumeration).finalize() line: 413
The LdapSearchEnumeration object is not the same object that was created during search operation, however all parameters (filters ets are the same).
So it brings up some questions:
Do additional LdapSearchEnumeration objects are created behind the scene while executing search with referrals (looks like it)?
How to get access to these additional objects?
Has anybody seen this behavior?
I do not see any problem while executing in non-debug mode, but I am concern that I might loose some resources (connections, memory etc).
I am using Sun com.sun.jndi.ldap.LdapCtxFactory and application run under Web Sphere application server version 6.
Any help / ideas are greatly appreciated
Yev

