<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 閱讀(2730) 評論(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蜜芽| 亚洲午夜成激人情在线影院| xxxxx做受大片在线观看免费 | 18禁在线无遮挡免费观看网站| 中文国产成人精品久久亚洲精品AⅤ无码精品| 在线视频免费国产成人| 日本卡1卡2卡三卡免费| 亚洲日韩在线观看免费视频| 精品国产污污免费网站aⅴ| 亚洲高清免费视频| 一级看片免费视频| 亚洲狠狠婷婷综合久久久久| 国内少妇偷人精品视频免费| 亚洲AV无码专区电影在线观看| 鲁大师在线影院免费观看| 亚洲国产电影在线观看| 成年女人18级毛片毛片免费观看| 亚洲人成无码网站在线观看| 免费人妻av无码专区| 韩国免费a级作爱片无码| 亚洲尹人九九大色香蕉网站| 国色精品卡一卡2卡3卡4卡免费| 亚洲人成综合网站7777香蕉| 免费a级毛片无码av| 国产羞羞的视频在线观看免费 | 亚洲国产成人一区二区三区| 最近的中文字幕大全免费8| 99久久婷婷国产综合亚洲| 免费国产成人午夜私人影视| 9久久免费国产精品特黄| 亚洲短视频男人的影院| 手机在线免费视频| 国产黄在线观看免费观看不卡| 亚洲邪恶天堂影院在线观看| 午夜免费福利影院| 99久久国产精品免费一区二区| 亚洲香蕉久久一区二区| 亚洲综合图色40p| 黄页网站免费观看| 丁香花在线观看免费观看图片 | 日本免费大黄在线观看|