This is an openHAB issue, not specific to Jython. The openHAB OSGi bundle load order seems to be incorrect at times. I haven’t had a problem with this myself, but others have reported similar issues. It might be related to the specific set of bundles you have configured for openHAB.
I don’t know of any great workarounds. Some people have put extra delays in various parts of the startup sequence, but that doesn’t seem like a very reliable solution to me.
I have noticed these problems in openHAB 1 but until now not in openHAB 2. In openHAB 1 they where always random, bit the error regarding the Jython rule is reported every time openHAB is restarted.
But thats probably one of the reasons, why JSR223 is designated as experimental…
In your environment… I’ve been running openHAB2 JSR223 Jython since before it was released and have not had the problem.
As I said before, this is not an issue specific to JSR223. That said, the JSR223 layer is using the “experimental” rules engine of openHAB2 but it’s not clear that this is directly relevant to your issue.