I'm pretty lame in Java, but indeed perhaps the object "creds" is wrong, for example "null" or something. Is there a way to display it, pretty much like "print_r" or "var_dump" in php?
Can you add a test, something like (not java code, just pseudo code ):
if creds==null then
print "I'm null!"
print "I exist"
have you tried casting the "cred.getUser()" to a string? - the getUser() call I believe returns a 'type', so cast the equivalent to a string:
e.g. String User = creds.getUser().ToString;