PubSub / Su Smack - Cant create PubSub Node / invalid conf... Please

Hello Folks

ejabberd 2.0.3
smack 3.1.0 (Library for Connecting to XMPP Server with Java Applications)
su smack 1.2 (Implementing PubSub to Smack)
ubuntu 8.10

Ive got a Project from my company to send generated Data (MEssages) over an Ejabberd Server to Clients. Ive installed and probably configured my ejabberdserver. With Smack i can already send data (messages directly adressed to another client/user) via my JavaProgram (My TestDataGenerator). Now i got to create a PubSub node, which i can adress from the test-data-generator and the node should share it to all subscribed clients.
I think my SuSmack works great, because the XML Stream looks like all the examples and mod_pubsub is answering, but with this message (forth-laptop is my local PC-name and server... and forth the user on my laptop):

=INFO REPORT==== 2009-02-04 14:35:21 ===
I(<0.309.0>:mod_pubsub:894) : Node ["home","forth","forth-laptop","pubsub"] ; invalid configuration: []

This is my XML Stream:

<iq id=\"q1RQ6-4\" to=\"pubsub.forth-laptop\" from=\"admin@forth-laptop\" type=\"set\">
<pubsub xmlns=\"http://jabber.org/protocol/pubsub\">
<create node='/home/forth/forth-laptop/pubsub'/>
</pubsub>
</iq>

I Already tried it with a <configure/> after the "create node=""" but then i get an AUTH Error!

Can someone please help? Its a Student work and i'm totaly stuck!!
I dont even know if the node name is right or if it even could be wrong , i tried so many things. And in the admin-webconfig there is a node called "ejabberd@localhost". Whats that?

Thanks a lot for anybody taking their time!

Here is my DebugLog from getting the stream to the message of the error-stream:

WITHOUT CONFIGURE::

=INFO REPORT==== 2009-02-04 14:35:21 ===
D(<0.456.0>:ejabberd_receiver:306) : Received XML on stream = "<iq id=\"q1RQ6-4\" to=\"pubsub.forth-laptop\" from=\"admin@forth-laptop\" type=\"set\">\n<pubsub xmlns=\"http://jabber.org/protocol/pubsub\">\n  <create node='/home/forth/forth-laptop/pubsub'/>\n</pubsub></iq>"

=INFO REPORT==== 2009-02-04 14:35:21 ===
D(<0.457.0>:ejabberd_router:301) : route
from {jid,"admin","forth-laptop","Home","admin","forth-laptop","Home"}
to {jid,[],"pubsub.forth-laptop",[],[],"pubsub.forth-laptop",[]}
packet {xmlelement,"iq",
                   [{"id","q1RQ6-4"},
                    {"to","pubsub.forth-laptop"},
                    {"from","admin@forth-laptop"},
                    {"type","set"}],
                   [{xmlcdata,<<"\n">>},
                    {xmlelement,"pubsub",
                        [{"xmlns","http://jabber.org/protocol/pubsub"}],
                        [{xmlcdata,<<"\n  ">>},
                         {xmlelement,"create",
                             [{"node","/home/forth/forth-laptop/pubsub"}],
                             []},
                         {xmlcdata,<<"\n">>}]}]}

=INFO REPORT==== 2009-02-04 14:35:21 ===
I(<0.309.0>:mod_pubsub:894) : Node ["home","forth","forth-laptop","pubsub"] ; invalid configuration: []

=INFO REPORT==== 2009-02-04 14:35:21 ===
D(<0.309.0>:ejabberd_router:301) : route
from {jid,[],"pubsub.forth-laptop",[],[],"pubsub.forth-laptop",[]}
to {jid,"admin","forth-laptop","Home","admin","forth-laptop","Home"}
packet {xmlelement,"iq",
                   [{"type","error"},
                    {"to","admin@forth-laptop"},
                    {"from","pubsub.forth-laptop"},
                    {"id","q1RQ6-4"}],
                   [{xmlcdata,<<"\n">>},
                    {xmlelement,"pubsub",
                        [{"xmlns","http://jabber.org/protocol/pubsub"}],
                        [{xmlcdata,<<"\n  ">>},
                         {xmlelement,"create",
                             [{"node","/home/forth/forth-laptop/pubsub"}],
                             []},
                         {xmlcdata,<<"\n">>}]},
                    {xmlelement,"error",
                        [{"code","400"},{"type","modify"}],
                        [{xmlelement,"bad-request",
                             [{"xmlns","urn:ietf:params:xml:ns:xmpp-stanzas"}],
                             []}]}]}

=INFO REPORT==== 2009-02-04 14:35:21 ===
D(<0.309.0>:ejabberd_local:279) : local route
from {jid,[],"pubsub.forth-laptop",[],[],"pubsub.forth-laptop",[]}
to {jid,"admin","forth-laptop","Home","admin","forth-laptop","Home"}
packet {xmlelement,"iq",
                           [{"type","error"},{"to",[...]},{[...],...},{...}],
                           [{xmlcdata,<<...>>},{xmlelement,...},{...}]}

=INFO REPORT==== 2009-02-04 14:35:21 ===
D(<0.309.0>:ejabberd_sm:372) : session manager
from {jid,[],"pubsub.forth-laptop",[],[],"pubsub.forth-laptop",[]}
to {jid,"admin","forth-laptop","Home","admin","forth-laptop","Home"}
packet {xmlelement,"iq",
                           [{"type","error"},{"to",[...]},{[...],...},{...}],
                           [{xmlcdata,<<...>>},{xmlelement,...},{...}]}

=INFO REPORT==== 2009-02-04 14:35:21 ===
D(<0.309.0>:ejabberd_sm:467) : sending to process <0.457.0>

=INFO REPORT==== 2009-02-04 14:35:21 ===
D(<0.457.0>:ejabberd_c2s:1346) : Send XML on stream = "<iq from='pubsub.forth-laptop' to='admin@forth-laptop/Home' type='error' id='q1RQ6-4'>\n<pubsub xmlns='http://jabber.org/protocol/pubsub'>\n  <create node='/home/forth/forth-laptop/pubsub'/>\n</pubsub><error code='400' type='modify'><bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>"

Two small errors in your stanza to create node

Your stanza has two problems:

  1. The user "admin@forth-laptop" can only create nodes in "/home/forth-laptop/admin/*" . Check How to use ejabberd's pubsub module
  2. ejabberd 2.0.3 implements XEP-0060 v1.12. It requires that a stanza for node creation includes 'create' element, and also 'configure' element. Probably you got confused by Example 113, that shows node creation without 'configure'. I'll report this mistake in the document.

This is wrong (needs to fix 1 and 2):

<iq to="pubsub.forth-laptop" from="admin@forth-laptop" type="set">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <create node='/home/forth/forth-laptop/pubsub'/>
  </pubsub>
</iq>

This is wrong (needs to fix 1):

<iq to="pubsub.forth-laptop" from="admin@forth-laptop" type="set">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <create node='/home/forth/forth-laptop/pubsub'/>
    <configure/>
  </pubsub>
</iq>

This is wrong (needs to fix 2):

<iq to="pubsub.forth-laptop" from="admin@forth-laptop" type="set">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <create node='/home/forth-laptop/admin'/>
  </pubsub>
</iq>

Finally, this is correct :D

<iq to="pubsub.forth-laptop" from="admin@forth-laptop" type="set">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <create node='/home/forth-laptop/admin'/>
    <configure/>
  </pubsub>
</iq>

Thanks

Thanks for the quick answer, helped me a lot!!!
:D

Syndicate content