开发者

javax.mail.Session constructor "is not visible"

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜