Projects tigase _server server-core Issues #1238
Can't set MOTD via ad-hoc. (#1238)
wojciech.kapcia@tigase.net opened 4 years ago
javax.script.ScriptException: tigase.kernel.KernelException: Can''t find bean implementing class tigase.xmpp.impl.MotdProcessor
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320)
	at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:71)
	at tigase.server.script.Script.runCommand(Script.java:122)
	at tigase.server.BasicComponent.processScriptCommand(BasicComponent.java:903)
	at tigase.component.ComponenScriptCommandProcessor.processScriptCommand(ComponenScriptCommandProcessor.java:45)
	at tigase.component.modules.impl.AdHocCommandModule.processScriptAdHoc(AdHocCommandModule.java:143)
	at tigase.component.modules.impl.AdHocCommandModule.process(AdHocCommandModule.java:132)
	at tigase.server.xmppsession.SessionManager.processCommand(SessionManager.java:1514)
	at tigase.cluster.SessionManagerClustered.processPacket(SessionManagerClustered.java:240)
	at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1397)
Caused by: tigase.kernel.KernelException: Can''t find bean implementing class tigase.xmpp.impl.MotdProcessor
	at tigase.kernel.core.Kernel.getInstance(Kernel.java:976)
	at tigase.kernel.core.Kernel.getInstance(Kernel.java:972)
	at tigase.kernel.core.Kernel.getInstance(Kernel.java:271)
	at tigase.admin.Script66.process(Script66.groovy:61)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.$$YJP$$invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
	at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:226)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:64)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:79)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:184)
	at tigase.admin.Script66.run(Script66.groovy:67)
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:317)
	... 9 more

Andrzej Wójcik (Tigase) commented 4 years ago

@wojtek Most likely MotdProcessor is not enabled and required by this script. Should we enable it by default or ...?

wojciech.kapcia@tigase.net commented 4 years ago

I think that would be reasonable. Do you see any downsides to having it enabled by default? (unfortunately before migrating ad-hocs away from groovy we have less control over bean dependencies - correct?)

Andrzej Wójcik (Tigase) commented 4 years ago

We could (I think) check if the bean is available before trying to fetch it from the kernel and if not available just return some kind of error, ie. "Enable MotdProcessor to use this feature".

wojciech.kapcia@tigase.net commented 4 years ago

That could work as well.

Andrzej Wójcik (Tigase) commented 4 years ago

@wojtek I know it could, but what would be better?

Andrzej Wójcik (Tigase) commented 4 years ago

The issue is now fixed and SetMOTD.groovy will report back an error about misconfiguration and will point the user to the server logs for more details.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
tigase-server-8.2.0
Spent time
45m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1238
Please wait...
Page is in error, reload to recover