I'd only expect to see this if you were trying to replace the default Sun SSL socket factory. The example definitely doesn't do that. It might also happen if you've over written the version of the JSSE that ships with 1.4 with one of the JSSE 1.0.? versions.
There's quite a lengthy discussion on this at:
But other than over writing the JSSE implementation, none of the scenarios really apply to executing the example.
Do any of the above apply in your case?