<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    天空是藍色的

    做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執行exe #helloworld //運行exe
    數據加載中……
    Weblogic-JNDI-MailSession-javaMail-java.io.NotSerializableException: javax.mail.Session
    import java.util.Properties;

    import javax.mail.Session
    ;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;

    public class SendMail {
        Context ic 
    = null;

        public SendMail() {
        }

        private Properties props
    ;

        public void send() throws Exception {

            // 使用JNDI查詢Mail Session
            try {

                /*
                 * Hashtable ht 
    = new Hashtable();
                 * ht.put(Context.INITIAL_CONTEXT_FACTORY,
                 * 
    "weblogic.jndi.WLInitialContextFactory");
                 * ht.put(Context.PROVIDER_URL, "t3://localhost:7001/slide/"); ic =
                 * new InitialContext(ht);
                 */
                ic 
    = getInitialContext();
                Session session = (Session) ic.lookup("mail/MailSession");

            } catch (NamingException e) {
                e.printStackTrace()
    ;
            }

        }

        public static void main(String args
    []) throws Exception {
            SendMail sendMail 
    = new SendMail();
            sendMail.send();
            System.out.println("send ok");
        }

        public Context getInitialContext() throws Exception {
            String url 
    = "t3://localhost:7001";
            String user = "weblogic";
            String password = "weblogic";
            Properties properties = null;
            try {
                properties 
    = new Properties();
                properties.put(Context.INITIAL_CONTEXT_FACTORY,
                        
    "weblogic.jndi.WLInitialContextFactory");
                properties.put(Context.PROVIDER_URL, url);
                if (user != null) {
                    properties.put(Context.SECURITY_PRINCIPAL
    , user);
                    properties.put(Context.SECURITY_CREDENTIALS,
                            password 
    == null ? "" : password);
                }

                return new InitialContext(properties)
    ;
            } catch (Exception e) {
                throw e
    ;
            }
        }

    }

    java.io.NotSerializableException: javax.mail.Session]

    相關帖子

    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=122&threadID=10958&tstart=1112

    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=121&threadID=27136&tstart=15

    http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=1&threadID=1450&tstart=1440

    weblogic配置

    服務-郵件-在此頁中,您可以定義此郵件會話的配置。

    名稱:MyMailSession
    JNDI 名稱:mail/MailSession
    屬性
    :
    mail.debug=true
    mail.smtp.port=25
    mail.smtp.auth=true
    mail.smtp.host=192.168.8.1

    用來配置此郵件會話的屬性。這些屬性名是在 JavaMail API 設計規范中指定的。





    posted on 2005-12-13 15:54 bluesky 閱讀(2719) 評論(2)  編輯  收藏 所屬分類: 工作總結

    評論

    # re: Weblogic-JNDI-MailSession-javaMail-java.io.NotSerializableException: javax.mail.Session 2011-09-27 20:07 Penny

    This is because the MailSession returned from the lookup is not serializable and thus you will get NULL from the lookup.

    Do the lookup the MailSession locally and you will solve the problem.
      回復  更多評論    

    # re: Weblogic-JNDI-MailSession-javaMail-java.io.NotSerializableException: javax.mail.Session 2011-10-14 13:59 Term Papers

    Very interesting ideas! I’ll be back for your new articles!
      回復  更多評論    
    主站蜘蛛池模板: 在线观看免费亚洲| 免费无码成人AV在线播放不卡| 亚洲AV无码一区二区三区牛牛| 亚洲沟沟美女亚洲沟沟| 色婷婷六月亚洲婷婷丁香| 婷婷亚洲久悠悠色悠在线播放| 亚洲VA中文字幕不卡无码| 亚洲AV日韩AV天堂久久| 亚洲国产精品人久久| 精品亚洲成a人片在线观看少妇| 亚洲高清在线播放| 亚洲精品国产福利在线观看| 亚洲一区免费在线观看| 亚洲熟伦熟女专区hd高清| 久久亚洲精品无码网站| 黄页网站在线观看免费| 一级毛片免费毛片毛片| 91免费在线视频| 99久久99久久精品免费观看| 国产91免费视频| 免费观看的毛片手机视频| 亚洲国产成人久久综合区| 亚洲精品亚洲人成人网| 亚洲性天天干天天摸| 亚洲成人高清在线观看| 中文字幕乱码亚洲无线三区| 国产偷国产偷亚洲高清人| 久久99精品免费一区二区| 久久久久成人片免费观看蜜芽 | 中文字幕亚洲色图| 亚洲人成7777影视在线观看| 亚洲高清一区二区三区电影| 污污免费在线观看| 国产午夜精品久久久久免费视| 日韩av无码久久精品免费| 噼里啪啦电影在线观看免费高清| 国产成人免费A在线视频| 亚洲欧洲精品无码AV| 亚洲国产成人久久精品app| 在线观看亚洲专区| 大地资源在线资源免费观看|