LDAP JDK LDAPReferralException .toString throws exception?

ohaya <[email protected]>
Newsgroups gmane.comp.mozilla.devel.directory
Message-ID <[email protected]>
Hi,

We have some older code that uses the Sun LDAP JDK (ldapjdk.jar) which, 
when run under JRE 1.42, works fine.  In this code, we do a search() in 
a try, with a catch, and in the catch, we do some output 
(System.out.println()).  This looks something like:

try {
.
.
ld.search(....);
.
.
} catch (LDAPReferralException e) {
   System.out.println("xxxx");
   System.out.println("xxx" + e.toString());
   .
   }


However, when we run this code under JRE 1.50_05, the code inside the 
catch is throwing what appears to be a Nullpointerexception at any line 
that is using e.toString().

I don't think the LDAPReferralException object itself is null, because 
some other methods on the object (e.g., e.getMessage()) seem to work.

We've tried a number of things, including re-compiling the code under 
JDK 1.50_05, but still see the same problem.

The only workaround for this that we've found so far is to either:

- Re-code to not use/output e.toString(), or
- Put the System.out.println(...e.toString()) inside another try (i.e., 
putting a try inside the catch).

Again, this problem only appears if the code is run under JRE 1.50.  It 
works fine when run under JRE 1.42_xx.

We can do the re-code, but I'm curious if anyone else has run across this?

Thanks,
Jim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.