尝试使用XMPP连接连接到服务器 [英] Try to connect to server with XMPP Connection

查看:475
本文介绍了尝试使用XMPP连接连接到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从BlackBerry设备连接到XMPP服务器。我搜索了网页,发现有准备使用XMPP类smack.jar文件。所以我创建了一个新的项目,并添加了smack.jar文件导入的jar文件。然后在项目中,我添加了以下内容:

I am trying to connect from a blackberry device to an XMPP server. I searched over the web and found the smack.jar file that has the XMPP classes ready for use. So I created a new project and added the smack.jar file to the imported jar files. Then in the project I added the following:

public void login(String userName, String password) throws XMPPException {
    ConnectionConfiguration config = new ConnectionConfiguration(IP, PORT, "gmail.com");
    connection = new XMPPConnection(config);
    connection.connect();
    connection.login(userName, password);
}

构建成功。现在运行模拟器和启动项目的时候,我收到以下错误:

The build is successful. Now when running the simulator and starting the project, i am getting the following error:

错误开始测试:模块'嫌-3.1.0'未找到

所以我删除从导入的jar文件smack.jar文件,并通过添加一个新的文件,并选择smack.jar手动添加它来该项目的类。构建项目时,我得到这个错误:

So I removed the smack.jar file from the imported jar files and added it manually to the classes of the project by adding a new file and selecting the smack.jar. When building the project I am getting this error:

org.jivesoftware.smack.AccountManager:错误!:缺少栈图中:supportsAccountCreation在标签:9

如何解决此问题?如何连接到XMPP服务器?也许是嫌不是正确的方式!

How to resolve this? How to connect to an XMPP server? Maybe smack isn't the right way!!

请我在这里需要一些帮助。

Please I need some help here

推荐答案

它看起来像咂嘴距离的 andtalk 项目。快速浏览网站,我没有看到本Java ME支持任何索赔要求。 BlackBerry设备不运行完整的Java SE code,它们只能运行Java ME code,所以大部分的库将无法工作。看起来,这是其中之一,将无法正常工作。

It looks like smack is from the andtalk project. Quickly browsing the site, I don't see any claims of Java-ME support. BlackBerry devices do not run full Java SE code, they can only run Java ME code, so most libraries won't work. It looks like this is one of them that won't work.

这篇关于尝试使用XMPP连接连接到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆