The key error is this:
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Since you’re connecting to Gmail, this shouldn’t happen. The most likely causes are:
- There’s a firewall or anti-virus program intercepting your request.
- There’s something wrong in your JDK installation preventing it from finding the trusted certificate authorities
- You’re running in an application server that has overridden the JDK’s list of trusted certificate authorities