I don’t know what has changed. I don’t even knwo where to begin…
I was running 2.0.something which I now bumped up to the snapshot release from today and now my *.rules aren’t working as they should.
Java isn’t exact my forte but everything was working just fine before.
Running Ubuntu 16.04 on an Odroid C1+
The behavior differs depending on if I power cycle the board or if I do a
$ sudo systemctl stop openhab2.service
followed by a
$ sudo systemctl start openhab2.service
I’m getting a few errors from
java.util.concurrent.locks.ReentrantLock
when power cycling the unit.
This is just a snippet from the *.rules file
import java.util.concurrent.locks.ReentrantLock
var ReentrantLock lock2 = new ReentrantLock()
openhab.log file
2018-12-05 19:49:45.175 [WARN ] [me.internal.engine.RuleContextHelper] - Variable 'lock2' on rule file 'homeAuto.rules' cannot be initialized with value 'org.eclipse.xtext.xbase.impl.XConstructorCallImplCustom@358822 (invalidFeatureIssueCode: null, validFeature: false, explicitConstructorCall: true, anonymousClassConstructorCall: false)': An error occurred during the script execution: null
Get an similar error from all locks created (and wherever they are used it crashes the rule).
This does not happen when I run a start/stop systemctl…
Tried a few times and it appears to be repetative.
With both types of starts I have several errors/problems similar to this one
openhab.log
2018-12-05 19:49:45.523 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'device_4_tmpStat': The name 'device_4_tmpStat' cannot be resolved to an item or type; line 968, column 7, length 16
*.items
Switch device_4_tmpStat "Device_4 - Tmp Status [%s]" <button> (stat) { channel="network:pingdevice:4:online" }
*.rules
rule "System start"
when
System started
then
postUpdate(device_1_tmpStat, OFF)
...
end
rule "device_4_tmpStat"
when
Item device_4_tmpStat changed
then
if (device_4_tmpStat.state == ON)
{
...
}
end
the if (device_4_tmpStat.state == ON) is line 968 in the *.rules file.
So there exists an item.
The item is initialiced in the “System started” rule.
The item is detected as changed and the rule activated but when I’m trying to compare the state of the item then it canno be resolved into an item or type.
Ideas as to what might be wroing or what I can try?