开发者

javax.mail.Session constructor "is not visible"

开发者 https://www.devze.com 2023-02-16 09:27 出处:网络
This is almost the same as the Google App Engine code for JavaMail use.Link It gives a Session constructor not visible error.The other imports seem fine so why is this happening to Session?

This is almost the same as the Google App Engine code for JavaMail use. Link

It gives a Session constructor not visible error. The other imports seem fine so why is this happening to Session?

import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import java.util.Properties;
import javax.mail.Session;
import javax.mail.Message;
import javax.mail.Transport;
import javax.开发者_运维问答mail.MessagingException;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

Properties props = new Properties();
Session session = new Session(props, null);


Session has no public constructor; you need to use the static getInstance() or getDefaultInstance() methods. See javadoc.

0

精彩评论

暂无评论...
验证码 换一张
取 消