Project

General

Profile

Issue loading pubsub scripts to tigase 7.0.2

NW NE
Added almost 4 years ago

Hi,

i have decided to get familiar with http api.

I downloaded mentioned pubsub scripts and put them to scripts/rest/pubsub.

When I start the server there are errors in log file for all of pubsub adhoc scripts (CreateNode, DeleteNode, PublishItem, SubscribeNode, UnsubscribeNode).

I copy here just one error block to save lines :)

2015-05-19 16:08:02.538 [main]             java_util_logging_Logger$log.call()  SEVERE: Exception loading handler from script = /opt/tigase702/scripts/rest/pubsub/CreateNode.groovy
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'tigase.admin.CreateNode@660483d2' with class 'tigase.admin.CreateNode' to class 'tigase.http.rest.Handler'
    at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:360)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:599)
    at tigase.http.rest.HandlersLoader.loadHandler(HandlersLoader.groovy:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at tigase.http.rest.HandlersLoader$_loadHandlers_closure1.doCall(HandlersLoader.groovy:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.Closure.call(Closure.java:411)
    at groovy.lang.Closure.call(Closure.java:427)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1326)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1298)
    at org.codehaus.groovy.runtime.dgm$148.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at tigase.http.rest.HandlersLoader.loadHandlers(HandlersLoader.groovy:51)
    at tigase.http.rest.HandlersLoader$loadHandlers.call(Unknown Source)
    at tigase.http.rest.RestServlet.loadHandlers(RestServlet.groovy:65)
    at tigase.http.rest.RestExtServlet.super$4$loadHandlers(RestExtServlet.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
    at tigase.http.rest.RestExtServlet.loadHandlers(RestExtServlet.groovy:43)
    at tigase.http.rest.RestExtServlet$loadHandlers.callCurrent(Unknown Source)
    at tigase.http.rest.RestServlet.init(RestServlet.groovy:60)
    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    at tigase.http.java.RequestHandler.registerServlet(RequestHandler.java:94)
    at tigase.http.java.RequestHandler.<init>(RequestHandler.java:59)
    at tigase.http.java.JavaStandaloneHttpServer.deploy(JavaStandaloneHttpServer.java:98)
    at tigase.http.java.JavaStandaloneHttpServer.deploy(JavaStandaloneHttpServer.java:77)
    at tigase.http.HttpServer.deploy(HttpServer.java:99)
    at tigase.http.rest.RestModule.start(RestModule.java:112)
    at tigase.http.HttpMessageReceiver.setProperties(HttpMessageReceiver.java:237)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addComponent(MessageRouter.java:108)
    at tigase.server.MessageRouter.addRouter(MessageRouter.java:145)
    at tigase.server.MessageRouter.setProperties(MessageRouter.java:704)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:540)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:177)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:131)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:603)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)

Do you have any idea, what went wrong?

regards,

n


Replies (3)

(1)

Added by NW NE almost 4 years ago

Just realised:

despite of aforementioned errors rest calls to pubsub component works.

Actually I have tried creating node only but it worked.

I expected the opposite.

Maybe related with pubsub starting errors i found another interesting error in tigase.console.log file:

2015-05-19 20:12:46.188 [sess-man tasks]   ThreadExceptionHandler.uncaughtException()  SEVERE: Uncaught thread: "sess-man tasks" exception
java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
    at tigase.server.xmppsession.SessionManager.everyMinute(SessionManager.java:2211)
    at tigase.server.AbstractMessageReceiver$3.run(AbstractMessageReceiver.java:1247)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

NW NE wrote:

Hi,

i have decided to get familiar with http api.

I downloaded mentioned pubsub scripts and put them to scripts/rest/pubsub.

When I start the server there are errors in log file for all of pubsub adhoc scripts (CreateNode, DeleteNode, PublishItem, SubscribeNode, UnsubscribeNode).

There are two kinds of scripts: admin ad-hoc scripts which you put in scripts/admin directory and there are REST scripts/handlers which you put in scripts/rest…

Scripts mentioned by you are the former (ad-hocs) which are executed through handlers from src/main/groovy/tigase

Also - everything is included in the distribution packages in correct locations so no need to aditionally copy anything.

NW NE wrote:

despite of aforementioned errors rest calls to pubsub component works.

Actually I have tried creating node only but it worked.

I expected the opposite.

That's because everything is alredy there but additional files are not loaded.

Maybe related with pubsub starting errors i found another interesting error in tigase.console.log file:

This is caused by the fact that this release was built with jdk8 and you're most likely starting it with jvm7. This exception can be ignored.

(1)

Added by NW NE almost 4 years ago

Thank you. Right, it was may mistake.

    (1-3/3)