Just a thought: on the same machine, try to connect to GMail using whatever email client is handy using the same settings. If this succeeds, then I would think the next step would be to deduce what is different between the settings in your code and the settings in the client.
When I get home maybe I will have time to try to hook up to GMail with JavaMail, but I do it a little differently. I use Velocity and templates because I send out merged mail, so I use the following from the Velocity/Spring examples:
protected MimeMessagePreparator prepareMessage (final String emailBody,
final String toAddress, final String fromAddress) throws MessagingException
MimeMessagePreparator preparator = new MimeMessagePreparator()
public void prepare (final MimeMessage mimeMessage)
MimeMessageHelper messageHelper = new MimeMessageHelper(
where _mailSender is a JavaMailSender configured for an internal SMTP server.
_mailSender.send(prepareMessage(body, toAddress, fromAddress ));
Hope this helps.