Project

General

Profile

I cannot create a node using the PubSub component

连生 张
Added 15 days ago

I cannot create a node using the PubSub component,
Request the address:POST http://localhost:8080/rest/pubsub/pubsub.zhangliansheng/create-node
The request data:

<data>
    <node>999999</node>
    <owner>admin@zhangliansheng</owner>
    <pubsub prefix="true">
    <node_type>leaf</node_type>
    </pubsub>
</data>

Content-Type: text/plain

Returns the result:504
Print log:

2019-01-09 14:03:18.381 [http-server-pool-4]  RequestHandler.handle()         FINEST:   received request for path = /rest/pubsub/pubsub.zhangliansheng/create-node
2019-01-09 14:03:18.382 [http-server-pool-4]  RestExtServlet.processRequest()  FINEST:  comparing request URI = /rest/pubsub/pubsub.zhangliansheng/create-node with /rest/pubsub
2019-01-09 14:03:18.382 [http-server-pool-4]  java_util_logging_Logger$finest$2.call()  FINEST: checking routings = [tigase.rest.pubsub.PubSubHandler@33a02ab, tigase.rest.pubsub.PubSubActionsHandler@7ba47c8a] for prefix = /rest/pubsub and uri = /pubsub.zhangliansheng/create-node
2019-01-09 14:03:18.383 [http-server-pool-4]  java_util_logging_Logger$finest$2.call()  FINEST: checking localUri = /pubsub.zhangliansheng/create-node, prefix = /rest/pubsub, regex = /(?:([^@/]+)@){0,1}([^@/]+)
2019-01-09 14:03:18.383 [http-server-pool-4]  java_util_logging_Logger$finest$2.call()  FINEST: checking localUri = /pubsub.zhangliansheng/create-node, prefix = /rest/pubsub, regex = /(?:([^@/]+)@){0,1}([^@/]+)/([^/]+)
2019-01-09 14:03:18.383 [http-server-pool-4]  java_util_logging_Logger$finest$2.call()  FINEST: found handler
2019-01-09 14:03:18.384 [http-server-pool-4]  java_util_logging_Logger$finest$2.call()  FINEST: got calling with params = [tigase.http.ServiceImpl@536ef600, tigase.http.rest.RestServlet$_execute_closure4@39b905c3, tigase.http.java.DummyServletRequest@377eec84, null, pubsub.zhangliansheng, create-node]
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.processPacket()  FINEST:  Processing packet: from=http@zhangliansheng/f8c40ae5-5379-400c-82ca-6b32132b177b, to=null, DATA=<iq from="http@zhangliansheng/f8c40ae5-5379-400c-82ca-6b32132b177b" type="set" xmlns="jabber:client" id="41c23379-62b6-4f87-a76f-63f7650d5c47" to="pubsub.zhangliansheng"><command xmlns="http://jabber.org/protocol/commands" node="create-node"><x type="submit" xmlns="jabber:x:data"><field var="node"><value>999999</value></field><field var="owner"><value>admin@zhangliansheng</value></field><field var="pubsub#node_type"><value>leaf</value></field></x></command></iq>, SIZE=466, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : pubsub.zhangliansheng
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): pubsub.zhangliansheng, for map: [proxy@zhangliansheng, bosh@zhangliansheng, http@zhangliansheng, vhost-man@zhangliansheng, eventbus@zhangliansheng, s2s@zhangliansheng, monitor@zhangliansheng, srecv@zhangliansheng, sess-man@zhangliansheng, ws2s@zhangliansheng, message-archive@zhangliansheng, muc@zhangliansheng, c2s@zhangliansheng, ssend@zhangliansheng, stats@zhangliansheng, basic-conf@zhangliansheng, pubsub@zhangliansheng]; trying VHost lookup
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): pubsub.zhangliansheng, for map: [vhost-man, c2s, monitor, ws2s, bosh, srecv, proxy, ssend, stats, eventbus, s2s, http, basic-conf, muc, message-archive, sess-man, message-router, pubsub], for all VHosts: [192.168.1.155, zhangliansheng]; trying other forms of addressing
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: Component matched: pubsub.zhangliansheng, for comp: [vhost-man, c2s, monitor, ws2s, bosh, srecv, proxy, ssend, stats, eventbus, s2s, http, basic-conf, muc, message-archive, sess-man, message-router, pubsub], basename: zhangliansheng
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : pubsub.zhangliansheng
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): pubsub.zhangliansheng, for map: [proxy@zhangliansheng, bosh@zhangliansheng, http@zhangliansheng, vhost-man@zhangliansheng, eventbus@zhangliansheng, s2s@zhangliansheng, monitor@zhangliansheng, srecv@zhangliansheng, sess-man@zhangliansheng, ws2s@zhangliansheng, message-archive@zhangliansheng, muc@zhangliansheng, c2s@zhangliansheng, ssend@zhangliansheng, stats@zhangliansheng, basic-conf@zhangliansheng, pubsub@zhangliansheng]; trying VHost lookup
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): pubsub.zhangliansheng, for map: [vhost-man, c2s, monitor, ws2s, bosh, srecv, proxy, ssend, stats, eventbus, s2s, http, basic-conf, muc, message-archive, sess-man, message-router, pubsub], for all VHosts: [192.168.1.155, zhangliansheng]; trying other forms of addressing
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: Component matched: pubsub.zhangliansheng, for comp: [vhost-man, c2s, monitor, ws2s, bosh, srecv, proxy, ssend, stats, eventbus, s2s, http, basic-conf, muc, message-archive, sess-man, message-router, pubsub], basename: zhangliansheng
2019-01-09 14:03:18.386 [in_14-message-router]  MessageRouter.processPacket()  FINEST:  1. Packet will be processed by: pubsub@zhangliansheng, from=http@zhangliansheng/f8c40ae5-5379-400c-82ca-6b32132b177b, to=null, DATA=<iq from="http@zhangliansheng/f8c40ae5-5379-400c-82ca-6b32132b177b" type="set" xmlns="jabber:client" id="41c23379-62b6-4f87-a76f-63f7650d5c47" to="pubsub.zhangliansheng"><command xmlns="http://jabber.org/protocol/commands" node="create-node"><x type="submit" xmlns="jabber:x:data"><field var="node"><value>999999</value></field><field var="owner"><value>admin@zhangliansheng</value></field><field var="pubsub#node_type"><value>leaf</value></field></x></command></iq>, SIZE=466, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set

Thank you for your reply.

init.properties (4.67 KB) init.properties 完整的配置文件
tigasedb.sql (600 KB) tigasedb.sql 完整的数据库
tigase-server.rar (95.8 MB) tigase-server.rar 完整的源代码

Replies (4)

Added by Wojciech Kapcia TigaseTeam 15 days ago

As per REST API:

It is also required that jid of Tigase HTTP API Component is added to list of service trusted jids to allow execution of ad-hoc commands.

Added by 连生 张 14 days ago

--admins=admin@192.168.1.155,admin@zhangliansheng,http@zhangliansheng,http@192.168.1.155
--virt-hosts=192.168.1.155,zhangliansheng

Is it so? But it cannot be used yet and the same error 504 is reported. Could you please help me change the project in the complete source code to be usable

Added by 连生 张 8 days ago

You also thank you for your reply, but I cannot receive the project published by the node owner after subscribing to the node

Added by Wojciech Kapcia TigaseTeam 7 days ago

连生 张 wrote:

--admins=admin@192.168.1.155,admin@zhangliansheng,http@zhangliansheng,http@192.168.1.155
--virt-hosts=192.168.1.155,zhangliansheng

Is it so? But it cannot be used yet and the same error 504 is reported. Could you please help me change the project in the complete source code to be usable

You are adding VHost (domain). You should add machine hostname - for example result of $ hostname command execution. In the logs you can also find line with the relevant information:

2018-12-19 13:14:24.358 [main]             DNSResolverDefault.<init>()             WARNING:  Resolving default host name: <hostname>…

You have to add all cluster nodes to that list. Alternatively you could use: http@{clusterNode}

    (1-4/4)