我試圖讓節點(在Android和使用asmack
庫),並嘗試發佈過該節點的一些內容,但遺憾的是 時node = (LeafNode) mgr.getNode(nodeNameTxt.getText().toString());
線被執行我收到以下錯誤無響應從服務器同時發佈到節點
No response from server.:
at org.jivesoftware.smackx.pubsub.packet.SyncPacketSend.getReply(SyncPacketSend.java:50)
at org.jivesoftware.smackx.pubsub.packet.SyncPacketSend.getReply(SyncPacketSend.java:61)
at org.jivesoftware.smackx.pubsub.PubSubManager.getNode(PubSubManager.java:161)
at com.bcl.NodeManager.publishNode(NodeManager.java:176)
at com.bcl.NodeManager.access$1(NodeManager.java:167)
at com.bcl.NodeManager$2.run(NodeManager.java:101)
at java.lang.Thread.run(Thread.java:1019)
這裏是我的代碼
PubSubManager mgr = new PubSubManager(xmpp, "pubusb.example.com");
// Get the node
LeafNode node;
try {
//HERE I AM GETTING THE ERROR
node = (LeafNode) mgr.getNode(nodeNameTxt.getText().toString());
node.send(new PayloadItem("test" + System.currentTimeMillis(),
new SimplePayload("book", "pubsub:test:book", "")));
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
即使下面的行得到執行我得到了同樣的錯誤
createLeaf = mgr.createNode(nodeNameTxt.getText().toString());
我真的不知道發生了什麼,因爲我已設置SmackConfiguration.setPacketReplyTimeout(10000);
和服務器運行良好與stophe的JavaScript樣本也。
任何人都可以幫我通過這個plz – Hunt 2012-08-12 13:50:17