Fixing Samples : Includes modifications in all samples, for displaying

the error's in a more user friendly way. Modifications for NPE's in code
also a part of this commit. @OpenNTF

Review would include reviewing all samples.
Files modified for NPE's : 
> JsonJavaFactory
> OAuthHandler