Project

General

Profile

Getting a script execution error when trying to publish a message:

Peter Rajcani
Added about 4 years ago

I am getting script execution error when trying to publish a message:

I am using the command line tool:

https://projects.tigase.org/projects/tigase-pubsub/wiki/Ad-hoc_commands

Using the command line tool, I was able to create a pub sub node and subscribe to it with both users that I created:

create node:

./bin/tclmt.sh -u admin@Peters-MacBook-Pro.local -p tigase remote pubsub.Peters-MacBook-Pro.local create-node pubsub-test1 admin@Peters-MacBook-Pro.local leaf

subscribe:

./bin/tclmt.sh -u admin@Peters-MacBook-Pro.local -p tigase remote pubsub.Peters-MacBook-Pro.local subscribe-node pubsub-test1 test1@Peters-MacBook-Pro.local,test2@Peters-MacBook-Pro.local

However, the publish command gives an error:

./bin/tclmt.sh -u admin@Peters-MacBook-Pro.local -p tigase remote pubsub.Peters-MacBook-Pro.local publish-item pubsub-test1 item-1 '<entry><title>Hello</title></entry>'

Here are the details on the error:

Dec 10, 2014 5:09:35 PM tigase.xml.db.XMLDB setupNewDB
INFO: Create empty DB.
awaiting response...
Title:      Publish item to a node
Instructions:   Fill out this form to publish item to a node.
awaiting response...
Note: Script execution error.
Error message: groovy.lang.MissingMethodException: No signature of method: tigase.pubsub.modules.PublishItemModule.prepareNotification() is applicable for argument types: (tigase.xml.Element, tigase.xmpp.JID, java.lang.String, tigase.pubsub.LeafNodeConfig, tigase.pubsub.repository.cached.NodeAffiliations, tigase.pubsub.modules.ext.presence.PresenceNodeSubscriptions) values: [&lt;items node=&quot;pubsub-test1&quot;&gt;&lt;item id=&quot;item-1&quot;&gt;&lt;entry&gt;&lt;title&gt;Hello&lt;/title&gt;&lt;/entry&gt;&lt;/item&gt;&lt;/items&gt;, ...]
Debug info: [groovy.lang.MissingMethodException: No signature of method: tigase.pubsub.modules.PublishItemModule.prepareNotification() is applicable for argument types: (tigase.xml.Element, tigase.xmpp.JID, java.lang.String, tigase.pubsub.LeafNodeConfig, tigase.pubsub.repository.cached.NodeAffiliations, tigase.pubsub.modules.ext.presence.PresenceNodeSubscriptions) values: [&lt;items node=&quot;pubsub-test1&quot;&gt;&lt;item id=&quot;item-1&quot;&gt;&lt;entry&gt;&lt;title&gt;Hello&lt;/title&gt;&lt;/entry&gt;&lt;/item&gt;&lt;/items&gt;, ...], javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: tigase.pubsub.modules.PublishItemModule.prepareNotification() is applicable for argument types: (tigase.xml.Element, tigase.xmpp.JID, java.lang.String, tigase.pubsub.LeafNodeConfig, tigase.pubsub.repository.cached.NodeAffiliations, tigase.pubsub.modules.ext.presence.PresenceNodeSubscriptions) values: [&lt;items node=&quot;pubsub-test1&quot;&gt;&lt;item id=&quot;item-1&quot;&gt;&lt;entry&gt;&lt;title&gt;Hello&lt;/title&gt;&lt;/entry&gt;&lt;/item&gt;&lt;/items&gt;, ...], org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:349), org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41), tigase.server.script.Script.runCommand(Script.java:182), tigase.server.BasicComponent.processScriptCommand(BasicComponent.java:1053), tigase.component2.AbstractComponent.processCommandPacket(AbstractComponent.java:165), tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:186), tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475), null]

I followed the sample command provided in the wiki. Are the arguments correct?


Replies (10)

Added by Wojciech Kapcia TigaseTeam about 4 years ago

What Tigase Server / Tigase Pubsub do you use? Can you try latest nightlies

(1)

Added by Peter Rajcani about 4 years ago

Now I get a repository access error when I try to create another node:

./bin/tclmt.sh -u admin@Peters-MacBook-Pro.local -p tigase remote pubsub.Peters-MacBook-Pro.local create-node test admin@Peters-MacBook-Pro.local leaf

Dec 11, 2014 2:41:28 PM tigase.xml.db.XMLDB setupNewDB

INFO: Create empty DB.

awaiting response...

Title: Creating a node

Instructions: Fill out this form to create a node.

awaiting response...

Note: Script execution error.

Error message: tigase.pubsub.repository.RepositoryException: Problem accessing repository.

Debug info: [tigase.pubsub.repository.RepositoryException: Problem accessing repository., javax.script.ScriptException: tigase.pubsub.repository.RepositoryException: Problem accessing repository., org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:349), org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41), tigase.server.script.Script.runCommand(Script.java:182), tigase.server.BasicComponent.processScriptCommand(BasicComponent.java:1053), tigase.component2.AbstractComponent.processCommandPacket(AbstractComponent.java:165), tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:186), tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475), null]

Added by Peter Rajcani about 4 years ago

I downloaded and installed the latest Tigase build (version 7.0.0) and I got 'Feature not implemented' error when I try to create a PubSub node:

./bin/tclmt.sh -u admin@Peters-MacBook-Pro.local -p tigase remote pubsub.Peters-MacBook-Pro.local create-node pubsub-test1 admin@Peters-MacBook-Pro.local leaf

Dec 11, 2014 3:11:41 PM tigase.xml.db.XMLDB setupNewDB

INFO: Create empty DB.

awaiting response...

Errors: [feature-not-implemented]

Added by Peter Rajcani about 4 years ago

Got it working when I replaced 'pubsub.Peters-MacBook-Pro.local' by 'pubsub@Peters-MacBook-Pro.local':

Peters-MacBook-Pro:tclmt-1.0.0-SNAPSHOT prajcani$ ./bin/tclmt.sh -u admin@Peters-MacBook-Pro.local -p tigase remote pubsub@Peters-MacBook-Pro.local create-node pubsub-test1 admin@Peters-MacBook-Pro.local leaf

Dec 11, 2014 3:27:51 PM tigase.xml.db.XMLDB setupNewDB

INFO: Create empty DB.

awaiting response...

Title: Creating a node

Instructions: Fill out this form to create a node.

awaiting response...

Note: Operation successful

Peters-MacBook-Pro:tclmt-1.0.0-SNAPSHOT prajcani$ ./bin/tclmt.sh -u admin@Peters-MacBook-Pro.local -p tigase remote pubsub@Peters-MacBook-Pro.local subscribe-node pubsub-test1 user1@Peters-MacBook-Pro.local

Dec 11, 2014 3:29:26 PM tigase.xml.db.XMLDB setupNewDB

INFO: Create empty DB.

awaiting response...

Title: Subscribe to a node

Instructions: Fill out this form to subscribe to a node.

awaiting response...

Note: Operation successful

Peters-MacBook-Pro:tclmt-1.0.0-SNAPSHOT prajcani$ ./bin/tclmt.sh -u admin@Peters-MacBook-Pro.local -p tigase remote pubsub@Peters-MacBook-Pro.local publish-item pubsub-test1 item-1 'Hello'

Dec 11, 2014 3:31:25 PM tigase.xml.db.XMLDB setupNewDB

INFO: Create empty DB.

awaiting response...

Title: Publish item to a node

Instructions: Fill out this form to publish item to a node.

awaiting response...

Script result: [Script finished with no errors but returned no results.]

(1)

Added by Abhinav Gupta about 3 years ago

Hi Peter, Wojciech Kapcia

I am trying the following

vostro@vostro-Vostro-3546:~/tigase/tclmt$ sh bin/tclmt.sh -u admin@blackbuck remote pubsub@blackbuck create-node Operations admin@blackbuck leaf

Nov 16, 2015 4:12:25 PM tigase.xml.db.XMLDB setupNewDB

INFO: Create empty DB.

awaiting response...

Errors: [forbidden, text]

Please review this and let me know if you can find any mistakes i might have done.

Attaching the logs and init file.

Any help & suggestions will be highly appreciated.

in the init file you may find that i have commented out the http reciever because when i tried using http reciever then tclmt gives me the connection refused error. I am trying to use the tclmt tool.

Thanks and Regards

Abhinav

Added by Wojciech Kapcia TigaseTeam about 3 years ago

Abhinav Gupta wrote:

Hi Peter, Wojciech Kapcia

I am trying the following

Please stop hijacking multiple threads with the same message!

vostro@vostro-Vostro-3546:~/tigase/tclmt$ sh bin/tclmt.sh -u admin@blackbuck remote pubsub@blackbuck create-node Operations admin@blackbuck leaf

Nov 16, 2015 4:12:25 PM tigase.xml.db.XMLDB setupNewDB

INFO: Create empty DB.

awaiting response...

Errors: [forbidden, text]

as said in the other thread - please make sure user admin@blackbuck is configured as admin.

Added by Abhinav Gupta about 3 years ago

Thanks,

I get it to work.

Added by Abhinav Gupta about 3 years ago

Hi Peter & Wojciech Kapcia,

I am facing another issue here,

I was able to create node successfully and was able to subscribe to the node but when i try to publish some data to the node, i am facing the issue below,

vostro@vostro-Vostro-3546:~/tigase/tclmt$ sh bin/tclmt.sh -u admin@blackbuck -p tigase remote pubsub@blackbuck publish-item Operations item-1 'Example 1'

the response goes into, what i think is a loop,

Instructions: Fill out this form to publish item to a node.

awaiting response...

Title: Publish item to a node

Instructions: Fill out this form to publish item to a node.

awaiting response...

Title: Publish item to a node

Instructions: Fill out this form to publish item to a node.

awaiting response...

Title: Publish item to a node

Instructions: Fill out this form to publish item to a node.

awaiting response...

Title: Publish item to a node

Instructions: Fill out this form to publish item to a node.

awaiting response...

Title: Publish item to a node

Instructions: Fill out this form to publish item to a node.

awaiting response...

Title: Publish item to a node

Instructions: Fill out this form to publish item to a node.

awaiting response...

Title: Publish item to a node

Instructions: Fill out this form to publish item to a node.

awaiting response...

after wards it gives the socket timeout exception.

Please help me.

(1)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 3 years ago

I checked this issue and it looks that we added additional parameter expire-at to publish-item adhoc command which is before item element parameter. As this changes number and order of parameters you need to adjust parameters passed to TCLMT. I think it now should look like:

~/tigase/tclmt$ sh bin/tclmt.sh -u admin@blackbuck -p tigase remote pubsub@blackbuck publish-item Operations item-1 '' '<entry><title>Example 1</title></entry>'

note empty string passed as expire-at parameter ('' just before entry element)

    (1-10/10)