OH 2.5.X don't get jsr223 jython running

I need some help on getting Scripting running on my latest OH installation

i followed:
Installation for installation

and

Installation 2

but i get error messages in logfile, does somebody have a hint for me ?

Blockquote
:/mnt/data/openhab/userdata/logs$ cat openhab.log | grep Scrip
2020-05-05 09:49:11.520 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:2.5.0 (337)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(397)] : The addScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: javax/script/ScriptEngineFactory
at javax.script.ScriptEngineManager.initEngines(ScriptEngineManager.java:123) ~[java.scripting:?]
at javax.script.ScriptEngineManager.init(ScriptEngineManager.java:87) ~[java.scripting:?]
at javax.script.ScriptEngineManager.(ScriptEngineManager.java:62) ~[java.scripting:?]
at org.openhab.core.automation.module.script.ScriptEngineFactory.(ScriptEngineFactory.java:35) ~[?:?]
at org.openhab.core.automation.module.script.AbstractScriptEngineFactory.getScriptTypes(AbstractScriptEngineFactory.java:42) ~[?:?]
at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.addScriptEngineFactory(ScriptEngineManagerImpl.java:63) ~[?:?]
2020-05-05 09:49:11.652 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:2.5.0 (337)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(397)] : The addScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
at org.openhab.core.automation.module.script.internal.NashornScriptEngineFactory.getScriptTypes(NashornScriptEngineFactory.java:47) ~[?:?]
at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.addScriptEngineFactory(ScriptEngineManagerImpl.java:63) ~[?:?]
2020-05-05 09:49:11.748 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:2.5.0 (337)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(397)] : The removeScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
at org.openhab.core.automation.module.script.AbstractScriptEngineFactory.getScriptTypes(AbstractScriptEngineFactory.java:42) ~[?:?]
at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.removeScriptEngineFactory(ScriptEngineManagerImpl.java:91) ~[?:?]
2020-05-05 09:49:11.833 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:2.5.0 (337)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(397)] : The removeScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
at org.openhab.core.automation.module.script.internal.NashornScriptEngineFactory.getScriptTypes(NashornScriptEngineFactory.java:47) ~[?:?]
at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.removeScriptEngineFactory(ScriptEngineManagerImpl.java:91) ~[?:?]
2020-05-05 09:49:12.189 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:2.5.0 (337)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(397)] : The addScriptEngineFactory method has thrown an exception

Blockquote

2020-05-05 09:49:10.116 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added AnnotatedThingActionModuleTypeProvider
2020-05-05 09:49:10.654 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added MediaModuleHandlerFactory
2020-05-05 09:49:11.520 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:2.5.0 (337)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(397)] : The addScriptEngineF
actory method has thrown an exception
java.lang.NoClassDefFoundError: javax/script/ScriptEngineFactory
at java.lang.ClassLoader.findBootstrapClass(Native Method) ~[?:?]
at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1257) ~[?:?]
at java.lang.System$2.findBootstrapClassOrNull(System.java:2126) ~[?:?]
at jdk.internal.loader.ClassLoaders$BootClassLoader.loadClassOrNull(ClassLoaders.java:118) ~[?:?]
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:618) ~[?:?]
at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
at org.eclipse.osgi.internal.framework.ContextFinder.loadClass(ContextFinder.java:127) ~[org.eclipse.osgi-3.12.100.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:398) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1209) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1220) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264) ~[?:?]
at java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299) ~[?:?]
at java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384) ~[?:?]

Blockquote

thanks in advance!

Lars

Check

and/or

Please edit your OP and replace the block quotes with code fences. The easiest is to use three ``` before and after.

Your log looks odd to me, but you’ve filtered out a lot. My guess is that your Jython jar is corrupt. Try the beta Jython addon… it makes installation much easier.

1 Like

looks better now …

next step i will try hello world example

it’s running now, thanks!

2020-05-05 22:21:20.375 [DEBUG] [e.automation.internal.RuleEngineImpl] - The trigger 'Time_cron_0_10_-ae1712c08f1e11ea9cafc6afa3aa55e9' of rule '1738ea7f-3f71-4a5b-9957-8b4406afa01b' is triggered.
2020-05-05 22:21:20.403 [INFO ] [Jython Hello World (cron decorators)] - Hello World!

What caused the error you were getting and how did you resolve it? Even if it was fixed, it would still make it easier in the future to read your OP if you would cleanup the code fences.

i followed the advice to use the addon, removing my try to install jython and place the addin in addin folder lead me to working scripting