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

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

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

    隨筆-95  評論-31  文章-10  trackbacks-0
    問題: 
          出現 DIGEST-MD5, Not authcated 等等

    解決:
    smack版本:4.2.2
    pom.xml依賴


    <dependency>
                
    <groupId>org.igniterealtime.smack</groupId>
                
    <artifactId>smack-core</artifactId>
                
    <version>${smack.version}</version>
            
    </dependency>
            
    <dependency>
                
    <groupId>org.igniterealtime.smack</groupId>
                
    <artifactId>smack-im</artifactId>
                
    <version>${smack.version}</version>
            
    </dependency>
            
    <dependency>
                
    <groupId>org.igniterealtime.smack</groupId>
                
    <artifactId>smack-extensions</artifactId>
                
    <version>${smack.version}</version>
            
    </dependency>
            
    <dependency>
                
    <groupId>org.igniterealtime.smack</groupId>
                
    <artifactId>smack-tcp</artifactId>
                
    <version>${smack.version}</version>
            
    </dependency>
            
    <dependency>
                
    <groupId>org.igniterealtime.smack</groupId>
                
    <artifactId>smack-experimental</artifactId>
                
    <version>${smack.version}</version>
            
    </dependency>
            
    <dependency>
                
    <groupId>org.igniterealtime.smack</groupId>
                
    <artifactId>smack-sasl-provided</artifactId>
                
    <version>${smack.version}</version>
            
    </dependency>
            
    <dependency>
                
    <groupId>org.igniterealtime.smack</groupId>
                
    <artifactId>smack-java7</artifactId>
                
    <version>${smack.version}</version>
            
    </dependency>

    Smack的配置代碼:
        /**
         * 初始化對象工廠
         
    */
        
    public XMPPConnectionObjectPool() {
            
    //XMPP連接配置
            XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
            
    try {
                configuration 
    = builder.
                        setXmppDomain(domain).
                        setHost(ip).
                        setPort(port).
                        setCompressionEnabled(
    true).
                        setSecurityMode(ConnectionConfiguration.SecurityMode.disabled).build();
            } 
    catch (XmppStringprepException e) {
                LOGGER.error(
    "init XMPPTCPConnectionConfiguration failed! {}", e);
                
    throw new ServiceException("init XMPPTCPConnectionConfiguration failed!", ErrorCode.INIT_XMPP_CONFIG_FAILED);
            }
        }


    Smack連接openfire的代碼:
            try {
                xmpptcpConnection.connect();
                xmpptcpConnection.login(atomicIntegerLoginName.getAndIncrement() 
    + "", loginPassword, Resourcepart.from("web"));
            } 
    catch (SmackException | IOException | XMPPException | InterruptedException e) {
                LOGGER.error(
    "Login openfire failed! the reason is : {}", e.getMessage());
                
    throw new LoginServiceException(e);
            }


    以上方式如果還出現DIGEST-MD5, Not authcated 等等

    1:查看用戶名和密碼是否正確
    2:查看openfire的ofProperty表,找到這一行:
    查看where后面的條件是否是user_name, 也就是用什么字段來驗證用戶名和密碼的。即可解決

    完!
    posted on 2017-12-22 17:58 朔望魔刃 閱讀(389) 評論(0)  編輯  收藏 所屬分類: 即時通信
    主站蜘蛛池模板: 国产特级淫片免费看| 最近2019中文免费字幕在线观看| 亚洲精品在线免费观看| 亚洲av鲁丝一区二区三区| 国产午夜精品免费一区二区三区 | 免费观看男人免费桶女人视频| 亚洲精品日韩中文字幕久久久| 青青青国产手机频在线免费观看| 国产亚洲精品自在久久| 久久青草免费91线频观看不卡 | 女人裸身j部免费视频无遮挡| va亚洲va日韩不卡在线观看| 免费人成视频在线播放| 区三区激情福利综合中文字幕在线一区亚洲视频1 | 国产91色综合久久免费| 亚洲av成人一区二区三区| 成年男女男精品免费视频网站| 亚洲精品理论电影在线观看| 四虎影视免费永久在线观看| 好猛好深好爽好硬免费视频| 久久精品国产亚洲av成人| 成人黄色免费网址| 亚洲AV永久无码精品网站在线观看| 国产免费看插插插视频| 成全视成人免费观看在线看| 97se亚洲综合在线| 免费无码又爽又高潮视频| 一级特黄录像视频免费| 亚洲小视频在线观看| 性xxxx视频播放免费| 一级一片免费视频播放| 亚洲精品在线观看视频| 国内自产少妇自拍区免费| 国产va免费观看| 亚洲国产高清视频在线观看| 日本免费一区二区三区最新vr| 中文在线免费观看| 亚洲精品123区在线观看| 久久亚洲2019中文字幕| 999在线视频精品免费播放观看| 色九月亚洲综合网|