Script throws exception on openHAB startup, sometimes

Could you post your log with an example of these errors? Are you possibly experiencing some of the issues in this topic?

Hi Scott,
the update from 2.4 to 2.5 had not produced the issue, it started on one of the minor updates within 2.5. I think it was 2.5.2 to 2.5.3 but I’m not sure.

I’ve attached the complete openhab.log beginning with the startup after the update from 2.5.4-1 to 2.5.5-1 until it run without errors. I’ve only masked my coordinates in the Location settings. (it’s a tarball, but have to have a known extension to allow the upload. Please remove .txt from the filename to allow proper processing) openhab.log.tgz.txt (261.5 KB)

*Update: Clearing the cache only slowed down startup, but hadn’t helped to avoid the Java exeptions.

regards Jan

Yes, that’s an action that would be expected to make it worse (and is performed anyway as part of an upgrade)
Reportedly, it can two or three restarts to properly rebuild the cache, so see what’s left after that.

Your log looks to have rules loading before the Items are ready. I suggest scrapping the clunky old rules DSL and using scripted automation with Jython and the helper libraries, where you will not have this issue. If you want to stay with the rules DSL, then you should setup a way to delay the rules from loading.

I don’t stick to the rules, but I’ve never used Jython. Is there any documentation how to substitue the behavior of a rule in a Jython script? And how will this avoid the main issues I currently have with the pubholiday.script, which is parsed before the items are available?

The link I provided has links to more instruction. Post if you run into trouble converting. The rules DSL runs on the old rule engine, which has been removed in OH 3.0. The new rule engine does not have the same issue.