Project

General

Profile

Question about Tigase PubSub REST configuration

Peter Rajcani
Added about 4 years ago

I need help / clarification on how to configure the Pubsub REST API:

Here is the Tigase server configuration:

--comp-class-1 = tigase.muc.MUCComponent

--virt-hosts = Peters-MacBook-Pro.local

--user-db-uri = jdbc:derby:/Applications/Tigase-5.2.3-b3470/tigasedb

--user-db = derby

--admins = admin@Peters-MacBook-Pro.local

--comp-name-4 = message-archive

--comp-name-3 = proxy

config-type = --gen-config-def

--comp-name-2 = pubsub

--comp-name-1 = muc

--cluster-mode = true

--sm-plugins = +message-archive-xep-0136

--debug = server

--comp-class-4 = tigase.archive.MessageArchiveComponent

--comp-class-3 = tigase.socks5.Socks5ProxyComponent

--comp-class-2 = tigase.pubsub.PubSubComponent

--comp-name-5 = rest

--comp-class-5 = tigase.http.rest.RestMessageReceiver

rest/port=8080

rest/use-local-server[B]=true

As described on the wiki page, I downloaded the scripts for REST API from https://projects.tigase.org/projects/tigase-pubsub/repository/revisions/master/show/src/main/groovy/tigase/rest and copied to subpath scripts/rest/pubsub in Tigase XMPP Server directory.

However, when I start the Tigase server I get the following error in the console log:

2014-12-11 13:27:03.242 [main] BasicComponent.loadScripts() WARNING: Can't load the admin script file: scripts/admin/pubsub/PublishItem.groovy

javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

Script23.groovy: 43: unable to resolve class tigase.pubsub.modules.PublishItemModule.ItemPublishedHandler

@ line 43, column 1.

import tigase.pubsub.modules.PublishItemModule.ItemPublishedHandler

^

Script23.groovy: 151: unable to resolve class ItemPublishedHandler.ItemPublishedEvent

@ line 151, column 5.

new ItemPublishedHandler.ItemPublishedEvent(packet.getStanzaTo().getBareJID(), node, itemsToSend));

^

2 errors

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.compile(GroovyScriptEngineImpl.java:182)

at tigase.server.script.Script.init(Script.java:134)

at tigase.server.script.AddScriptCommand.addAdminScript(AddScriptCommand.java:86)

at tigase.server.BasicComponent.loadScripts(BasicComponent.java:1196)

at tigase.server.BasicComponent.setProperties(BasicComponent.java:973)

at tigase.server.AbstractMessageReceiver.setProperties(AbstractMessageReceiver.java:1013)

at tigase.component2.AbstractComponent.setProperties(AbstractComponent.java:282)

at tigase.pubsub.PubSubComponent.setProperties(PubSubComponent.java:494)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:550)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:182)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.Configurator.componentAdded(Configurator.java:33)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)

at tigase.server.MessageRouter.addComponent(MessageRouter.java:118)

at tigase.server.MessageRouter.addRouter(MessageRouter.java:155)

at tigase.server.MessageRouter.setProperties(MessageRouter.java:797)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:550)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:182)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.Configurator.componentAdded(Configurator.java:33)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)

at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:141)

at tigase.server.MessageRouter.setConfig(MessageRouter.java:696)

at tigase.server.XMPPServer.start(XMPPServer.java:142)

at tigase.server.XMPPServer.main(XMPPServer.java:112)

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

Script23.groovy: 43: unable to resolve class tigase.pubsub.modules.PublishItemModule.ItemPublishedHandler

@ line 43, column 1.

import tigase.pubsub.modules.PublishItemModule.ItemPublishedHandler

^

Script23.groovy: 151: unable to resolve class ItemPublishedHandler.ItemPublishedEvent

@ line 151, column 5.

new ItemPublishedHandler.ItemPublishedEvent(packet.getStanzaTo().getBareJID(), node, itemsToSend));

^

2 errors

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)

at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:927)

at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:575)

at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:524)

at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)

at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)

at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:244)

at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:202)

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getScriptClass(GroovyScriptEngineImpl.java:368)

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.compile(GroovyScriptEngineImpl.java:174)

at tigase.server.script.Script.init(Script.java:134)

at tigase.server.script.AddScriptCommand.addAdminScript(AddScriptCommand.java:86)

at tigase.server.BasicComponent.loadScripts(BasicComponent.java:1196)

at tigase.server.BasicComponent.setProperties(BasicComponent.java:973)

at tigase.server.AbstractMessageReceiver.setProperties(AbstractMessageReceiver.java:1013)

at tigase.component2.AbstractComponent.setProperties(AbstractComponent.java:282)

at tigase.pubsub.PubSubComponent.setProperties(PubSubComponent.java:494)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:550)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:182)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.Configurator.componentAdded(Configurator.java:33)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)

at tigase.server.MessageRouter.addComponent(MessageRouter.java:118)

at tigase.server.MessageRouter.addRouter(MessageRouter.java:155)

at tigase.server.MessageRouter.setProperties(MessageRouter.java:797)

at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:550)

at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:182)

at tigase.conf.Configurator.componentAdded(Configurator.java:50)

at tigase.conf.Configurator.componentAdded(Configurator.java:33)

at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)

at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:141)

at tigase.server.MessageRouter.setConfig(MessageRouter.java:696)

at tigase.server.XMPPServer.start(XMPPServer.java:142)

at tigase.server.XMPPServer.main(XMPPServer.java:112)

Can you please help with the configuration?


Replies (1)

Added by Peter Rajcani about 4 years ago

We resolved this issue by installing the latest Tigase server version - 7.0.0 and added the servlet jAR file (servlet-api-3.1.jar) from https://projects.tigase.org/projects/tigase-http-api/files and added the http component to init.properties:

--comp-name-5=http

--comp-class-5=tigase.http.HttpMessageReceiver

    (1-1/1)