The first answer from @carlos worked for me:
session.getProperties().put("mail.smtp.ssl.trust", "smtp.gmail.com");
I have tested the property below and worked perfectly for me too:
session.getProperties().put("mail.smtp.starttls.enable", "true");
The two properties alone solved this type of problem, but by guarantee I used both.