Startup Issue

Hi

I have a minor issue on startup of 2.2. I get some strange log messages from some rules…

2018-01-22 18:13:05.396 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule ‘Populate Functional Groups’: ‘endsWith’ is not a member of ‘java.lang.String’; line 20, column 31, length 30

The rule then get’s processed correctly later on. Here’s the whole rule

rule "Populate Functional Groups"
        when
                System started or
		Item sRepopulate_Groups changed from OFF to ON
        then
                logInfo("Rules","Populating functional groups")
                gRoot.allMembers.filter(s | s.name.endsWith("Battery")).forEach[ item | fgBatteries.addMember(item)]
		gRoot.allMembers.filter(s | s.name.endsWith("DOOR_Sensor")).forEach[ item | fgDoors.addMember(item)]
		gRoot.allMembers.filter(s | s.name.endsWith("WINDOW_Sensor")).forEach[ item | fgWindows.addMember(item)]		
		gRoot.allMembers.filter(s | s.name.endsWith("Network")).forEach[ item | fgNetDevices.addMember(item)]
                sRepopulate_Groups.postUpdate(OFF)
        end

Any reason why this would happen?

Yes, the rule is triggered before the system is initialized completely. You should add some timer to delay your rule.

You may have a look here, if you don’t need the complete stuff, this is at least an example to delay startup.

https://community.openhab.org/t/cleaning-up-the-startup-process-renaming-rules-windows-possible/38438