I have started to convert my rules to groovy. The rule itself works as long as the system is already up and running. But if I restart openHAB, I get
MissingPropertyException: No such property: itemRegistry
When I then touch the script file, it parses correctly. It looks like the scripting engine is not completely initialized when the rule is loaded. Is this a known problem, am I doing something wrong, or should I create an Issue?
Edit: just for reference, here is my rule file:
itemRegistry.get("gShutterLocks")
And this is the error message on startup:
2017-08-25 11:25:44.062 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script ‘file:/etc/openhab2/automation/jsr223/test.groovy’: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: itemRegistry for class: Script2
Regards,
vbier