<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!
      回復  更多評論    
    主站蜘蛛池模板: 亚洲成A人片在线观看无码3D| 日韩高清免费在线观看| 亚洲第一区精品日韩在线播放| 亚洲伊人久久大香线蕉结合| 男女做羞羞的事视频免费观看无遮挡| 老汉色老汉首页a亚洲| 91精品国产免费久久国语麻豆| 日韩亚洲AV无码一区二区不卡 | AV在线播放日韩亚洲欧| 亚洲免费中文字幕| 最近中文字幕mv免费高清电影| 亚洲一区二区影视| 男女啪啪永久免费观看网站| 亚洲国产高清国产拍精品| 国产a不卡片精品免费观看| 一级毛片a免费播放王色电影| 国产亚洲午夜高清国产拍精品 | xxxxwww免费| 亚洲熟女乱色一区二区三区| 免费永久看黄在线观看app| eeuss草民免费| 亚洲成人午夜电影| 国产精品无码一区二区三区免费| 一级片在线免费看| 亚洲av日韩av不卡在线观看| 青青青国产在线观看免费网站 | jizz在线免费播放| 亚洲精品人成在线观看| 成人免费a级毛片无码网站入口| 国产区图片区小说区亚洲区| 亚洲精品乱码久久久久66| 嘿嘿嘿视频免费网站在线观看| 在线精品自拍亚洲第一区| 精品久久香蕉国产线看观看亚洲| 亚欧人成精品免费观看| 精品在线免费视频| 久久精品国产精品亚洲毛片| 国产精品色午夜免费视频| 日本免费久久久久久久网站| 亚洲人成人无码.www石榴| 亚洲国产精品国自产拍电影|