This line is wrong:
return new PasswordAuthentication("firstname.lastname@example.org",password.toCharArray());. According to the javax.mail documentation in JEE, this constructor is signatured with
PasswordAuthentication(String, String). java.net.PasswordAuthentication on the other hand is signatured with
Since you don't have a FQN for the PasswordAuthentication and the error doesn't appear to be a missing class, this indicates that you have an import for java.net.PasswordAuthentication, when you should be using javax.mail.PasswordAuthentication. Either alter the import (if nothing else requires it), or modify this new call the javax.mail.PasswordAuthentication.