- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在android中创建一个即时消息应用程序并尝试使用smack和xmpp的openfire服务器创建一个新用户,用户将存储在openfire数据库中但每次我运行它时,用户记录都不是显示在其中。
创建用户 Activity
private void setConnection() {
// Create the configuration for this new connection
//this function or code given in official documention give an error in openfire run locally to solve this error
//first off firewall
//then follow my steps
new Thread() {
@Override
public void run() {
InetAddress addr = null;
try {
// inter your ip4address now checking it
addr = InetAddress.getByName("192.168.23.150");
} catch (UnknownHostException e) {
e.printStackTrace();
}
HostnameVerifier verifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return false;
}
};
DomainBareJid serviceName = null;
try {
serviceName = JidCreate.domainBareFrom("localhost");
} catch (XmppStringprepException e) {
e.printStackTrace();
}
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setUsernameAndPassword("admin","kalaBOOK98")
.setPort(9090)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setXmppDomain(serviceName)
.setHostnameVerifier(verifier)
.setHostAddress(addr)
.setDebuggerEnabled(true)
.build();
Log.v(TAG,"connection configured");
mConnection = new XMPPTCPConnection(config);
//now send message and receive message code here
AccountManager accountManager = AccountManager.getInstance(mConnection);
try {
Log.v(TAG,"Creating new user");
accountManager.createAccount(Localpart.from(userId),userPassword);
} catch (SmackException.NoResponseException e) {
Log.v(TAG,"Error in creating user"+e);
e.printStackTrace();
} catch (XMPPException.XMPPErrorException e) {
Log.v(TAG,"Error in creating user"+e);
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
Log.v(TAG,"Error in creating user"+e);
e.printStackTrace();
} catch (InterruptedException e) {
Log.v(TAG,"Error in creating user"+e);
e.printStackTrace();
} catch (XmppStringprepException e) {
Log.v(TAG,"Error in creating user"+e);
e.printStackTrace();
}
}
// Now we create the account:
// The account has been created, so we can now login
}.start();
}
每次我尝试运行它时都会出现此日志错误
日志
2018-11-30 18:44:16.186 12186-12855/com.example.user.myapplication V/SignupActivity: connection configured
2018-11-30 18:44:16.216 12186-12855/com.example.user.myapplication V/SignupActivity: Creating new user
2018-11-30 18:44:16.218 12186-12855/com.example.user.myapplication V/SignupActivity: Error in creating userorg.jivesoftware.smack.SmackException$NotConnectedException: Client is not, or no longer, connected.
2018-11-30 18:44:16.218 12186-12855/com.example.user.myapplication W/System.err: org.jivesoftware.smack.SmackException$NotConnectedException: Client is not, or no longer, connected.
2018-11-30 18:44:16.226 12186-12855/com.example.user.myapplication W/System.err: at org.jivesoftware.smack.tcp.XMPPTCPConnection.throwNotConnectedExceptionIfAppropriate(XMPPTCPConnection.java:354)
2018-11-30 18:44:16.226 12186-12855/com.example.user.myapplication W/System.err: at org.jivesoftware.smack.AbstractXMPPConnection.sendStanza(AbstractXMPPConnection.java:670)
2018-11-30 18:44:16.227 12186-12855/com.example.user.myapplication W/System.err: at org.jivesoftware.smack.AbstractXMPPConnection.createStanzaCollectorAndSend(AbstractXMPPConnection.java:769)
2018-11-30 18:44:16.227 12186-12855/com.example.user.myapplication W/System.err: at org.jivesoftware.smackx.iqregister.AccountManager.createStanzaCollectorAndSend(AccountManager.java:370)
2018-11-30 18:44:16.227 12186-12855/com.example.user.myapplication W/System.err: at org.jivesoftware.smackx.iqregister.AccountManager.getRegistrationInfo(AccountManager.java:366)
2018-11-30 18:44:16.227 12186-12855/com.example.user.myapplication W/System.err: at org.jivesoftware.smackx.iqregister.AccountManager.getAccountAttributes(AccountManager.java:184)
2018-11-30 18:44:16.227 12186-12855/com.example.user.myapplication W/System.err: at org.jivesoftware.smackx.iqregister.AccountManager.createAccount(AccountManager.java:249)
2018-11-30 18:44:16.227 12186-12855/com.example.user.myapplication W/System.err: at com.example.user.myapplication.Login.SignupActivity$3.run(SignupActivity.java:192)
任何帮助将不胜感激提前致谢
最佳答案
如果您已经在 openfire 上创建了一个用户,那么您不需要从移动应用程序使用 AccountManager 创建它。构建 xmppTcpConnection 后,只需连接并使用新用户的凭据登录即可。
关于java - 无法使用 smack 在 openfire 中添加新用户 - android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53559918/
我在玩 strophe 和 Openfire 3.7.1(带有用户服务和监控插件)。 我读过 http://xmpp.org/extensions/xep-0136.html (7.2 检索集合) 我
我在html表单上输入jid和pwd,并使用Strope连接到openfire,但是当我按下登录按钮时,xmpp服务器响应是错误302。我在 openfire 上启用了该选项,然后重新启动它。 var
我是 smack API 的新手。我正在尝试开发一个聊天应用程序,我试图在其中设置和获取状态。 当我更改用户的存在时,它工作得很好,并且反射(reflect)在 Openfire 服务器中。 但是当我
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4 个月前关闭。 Improve t
openfire 4.0.2 https://github.com/igniterealtime/REST-API-Client 我正在使用 REST API 客户端将用户添加到房间。查看调试信息,似
是否可以使用 Strope.js 使用匿名用户创建新用户(带内注册),如示例所示:http://groups.google.com/group/strophe/browse_thread/thread
我正在使用以下软件进行 Android 聊天应用 XMPP 服务器:Openfire 3.9.3 XMPP 客户端:Asmack-android-8-4.0.4.jar 当我手动更改登录用户的存在时,
我正在使用 http-bind 和 openfire 来启用 BOSH 并使用 strophe 访问该服务,问题是我收到以下错误 Chrome 控制台报错 XMLHttpRequest cannot
Closed. This question is off-topic。它当前不接受答案。 想改善这个问题吗? Update the question,所以它是用于堆栈溢出的on-topic。 7年前关
我使用openfire 3.9.3服务器和Android和IOS作为客户端。我想在收件人用户离线时通过推送通知向两个客户端发送消息。当发送推送时,发送者应该收到消息收据。 为此,我尝试过: 制作拦截器
据我了解,邮件的默认大小为 1MB。 有没有办法重新配置限制。 对此问题的任何帮助将不胜感激。 谢谢 最佳答案 您需要在Openfire中设置“xmpp.parser.buffer.size”属性(以
我在客户端上使用 OpenFire 服务器进行即时消息传递和 JSJaC JavaScript 库。我是 XMPP 技术的新手。 我想要的是加载时我想发送用户列表并接收每个用户的状态。就像是 $(fu
我正在制作一个 Openfire 插件,用于将消息从服务器发送到客户端。 客户端发送带有自定义扩展名的消息,无需添加属性,因为插件将决定收件人。但是 Openfire 会将其退回给发送者。如何使此
我使用的是Windows server 2012R2并安装了openfire 3.10.2。但现在停止工作吧。当我尝试从窗口服务启动它时,它显示消息 error message 下面是日志.. 201
所以我有这个代码来连接到 openfire XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration
目标:- 存储离线消息。 我无法存储离线消息。 我已经安装了用于将消息存储到服务器的监控服务插件。 普通消息存储在 ofMessageArchive 表中,离线消息存储在名为 ofOffline 的表
我正在开发 openfire 插件并面临一些性能问题。我的问题是哪种类型的插件集成最快。 数据包拦截器 智商处理器 组件 其他? 我正在使用数据包拦截器并考虑切换到 IQHandler 并通过 $iq
我通过扩展 AbstractComponent 类,基于 Whack 库构建了一个外部 openfire 组件。我希望客户端订阅我的组件,并在组件上线和离线时接收状态通知。所以我的问题是我们如何处理基
我正在尝试将 Openfire 与我使用 Mysql Workbench 创建的自定义 SQL 数据库连接起来。 我修改了 openfire.xml 文件如下: 9090
我正在为 Android 开发一个简单的聊天工具。我正在阅读有关 Openfire ante asmack API 的信息。显然,用户应该只能看到存储在他的设备中的联系人,所以:我如何知道存储在服务器
我是一名优秀的程序员,十分优秀!