- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当使用 Smack 将数据包发送到 openfire 时,我收到错误 remote-server-not-found(404) 。谁能解释一下错误是什么意思?是连接服务器失败还是数据包有问题?
PacketFilter responseFilter = new PacketIDFilter(packet.getPacketID());
PacketCollector response = connection.createPacketCollector(responseFilter);
connection.sendPacket(packet);
// Wait up to a certain number of seconds for a reply.
Packet result = response.nextResult(timeout);
// Stop queuing results
response.cancel();
if (result == null) {
throw new XMPPException("No response from server.");
}
else if (result.getError() != null) {
System.out.println("error:"+result.getError()); //i get error here.... 404
throw new XMPPException(result.getError());
}
//--- 以下是我如何连接到 openfire。
ConnectionConfiguration config = new ConnectionConfiguration("localhost", 5222);
config.setCompressionEnabled(true);
config.setSASLAuthenticationEnabled(true);
XMPPConnection connection = new XMPPConnection(config);
// Connect to the server
connection.connect();
// Log into the server
connection.login("test", "test","testresource");
我附上了我从日志中收到的 xmpp xml
正在发送....
<stream:stream to="localhost" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
<stream:stream to="xuser" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
<auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl"></auth>
<response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">Y2hhcnNldD11dGYtOCx1c2VybmFtZT0idGVzdCIscmVhbG09InpoYW5nIixub25jZT0ieHZacDFOdHlkcld6MVBzOFA0UGlnbWgrbHRieWtyclNYU0NLWVJaRyIsbmM9MDAwMDAwMDEsY25vbmNlPSIxdThheGtJSWgrSzhBLzFBSDRtTHJ5OUxDTE1OSFpBa0xvdlVGcVFGIixkaWdlc3QtdXJpPSJ4bXBwL3poYW5nIixtYXhidWY9NjU1MzYscmVzcG9uc2U9MGE3YzEzOWRkODliZjk5NDcxN2ZiNjQzY2E5NWM3ZDUscW9wPWF1dGgsYXV0aHppZD0idGVzdCI=</response>
<stream:stream to="xuser" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
<iq id="CHWuJ-0" type="set"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>god</resource></bind></iq>
<iq id="CHWuJ-1" type="set"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
<compress xmlns='http://jabber.org/protocol/compress'>
<method>zlib</method></compress>
<stream:stream to="xuser" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
<iq id="CHWuJ-2" type="get"><query xmlns="jabber:iq:roster"></query></iq>
<presence id="CHWuJ-3"></presence>
<iq id="CHWuJ-4" to="pubsub.my.openfire.server" type="set"><pubsub xmlns="http://jabber.org/protocol/pubsub"><create node='TestNode2323'/><configure><x xmlns="jabber:x:data" type="submit"><field var="pubsub#persist_items" type="boolean"><value>0</value></field><field var="pubsub#deliver_payloads" type="boolean"><value>1</value></field><field var="pubsub#access_model" type="list-single"><value>open</value></field></x></configure></pubsub></iq>
收到....
<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="xuser" id="d0689fdf" xml:lang="en" version="1.0"><stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"></starttls>
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>
zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features><proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="xuser" id="d0689fdf" xml:lang="en" version="1.0"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression>
<auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>
<challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
cmVhbG09InpoYW5nIixub25jZT0ieHZacDFOdHlkcld6MVBzOFA0UGlnbWgrbHRieWtyclNYU0NLWVJaRyIscW9wPSJhdXRoIixjaGFyc2V0PSJ1dGYtOCIsYWxnb3JpdGhtPSJtZDUtc2VzcyI=</challenge>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
cnNwYXV0aD1jOWIyOWIxYTMwN2Q5ZjdkYmZiOGM4MDBkMTU4OWFmZQ==</success>
<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="xuser" id="d0689fdf" xml:lang="en" version="1.0"><stream:features><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features>
<iq type="result" id="CHWuJ-0" to="xuser/d0689fdf"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>test@xuser/god</jid></bind></iq>
<iq type="result" id="CHWuJ-1" to="test@xuser/god"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
<compressed xmlns='http://jabber.org/protocol/compress'/>
<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="xuser" id="d0689fdf" xml:lang="en" version="1.0"><stream:features><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features>
<iq type="result" id="CHWuJ-2" to="test@xuser/god"><query xmlns="jabber:iq:roster"><item jid="test" name="test" subscription="none"/></query></iq>
<iq type="error" id="CHWuJ-4" to="test@xuser/god" from="pubsub.my.openfire.server"><pubsub xmlns="http://jabber.org/protocol/pubsub"><create node="TestNode2323"/><configure><x xmlns="jabber:x:data" type="submit"><field var="pubsub#persist_items" type="boolean"><value>0</value></field><field var="pubsub#deliver_payloads" type="boolean"><value>1</value></field><field var="pubsub#access_model" type="list-single"><value>open</value></field></x></configure></pubsub><error code="404" type="cancel"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
解释..
<iq id="CHWuJ-0" to="xuser/d0689fdf" type="result"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>test@xuser/god</jid></bind></iq>
<iq id="CHWuJ-1" to="test@xuser/god" type="result"></iq>
<iq id="CHWuJ-2" to="test@xuser/god" type="result"><query xmlns="jabber:iq:roster"><item jid="test" name="test" subscription="none"></item></query></iq>
<iq id="CHWuJ-4" to="test@xuser/god" from="pubsub.my.openfire.server" type="error"><pubsub xmlns="http://jabber.org/protocol/pubsub"><create node='TestNode2323'/><configure xmlns="http://jabber.org/protocol/pubsub"><value>0</value></configure></pubsub><error code="404" type="CANCEL"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
最佳答案
我遇到了一个类似的问题,最近才解决。
我有一个 Openfire 服务器在我的本地计算机上运行,我正在使用 Smack API 与服务器通信。在 Openfire 中,我定义了两个用户:发送者和接收者。我没有使用电子邮件地址作为用户名。
在我的代码中,我在一个线程上有一个“发送者”连接,在一个单独的线程上有一个“接收者”连接。最初,在发送消息时,我收到了来自 Openfire 服务器的 remote-server-not-found(404)
错误响应。我发现,在发送方创建聊天请求时,我需要将参与者设置为receiver@[Openfire domain]
。
因此,如果您的 Openfire 域是 foo,它将是 receiver@foo
。显然,这不是“接收方”用户的电子邮件地址。通常,域实际上只是运行 Openfire 服务器的机器的名称。
关于java - openfire smack发送包404错误是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1558050/
我在玩 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 的信息。显然,用户应该只能看到存储在他的设备中的联系人,所以:我如何知道存储在服务器
我是一名优秀的程序员,十分优秀!